Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition of SCALE CSAS sequence in scale interface #2155

Merged
merged 16 commits into from
Aug 9, 2023

Conversation

alfoa
Copy link
Collaborator

@alfoa alfoa commented Jul 21, 2023


Pull Request Description

What issue does this change request address? (Use "#" before the issue to link it, i.e., #42.)

Closes #2154

What are the significant changes in functionality due to this change request?

Addition of the CSAS sequence in SCALE interface.
Updated manual and added test


For Change Control Board: Change Request Review

The following review must be completed by an authorized member of the Change Control Board.

  • 1. Review all computer code.
  • 2. If any changes occur to the input syntax, there must be an accompanying change to the user manual and xsd schema. If the input syntax change deprecates existing input files, a conversion script needs to be added (see Conversion Scripts).
  • 3. Make sure the Python code and commenting standards are respected (camelBack, etc.) - See on the wiki for details.
  • 4. Automated Tests should pass, including run_tests, pylint, manual building and xsd tests. If there are changes to Simulation.py or JobHandler.py the qsub tests must pass.
  • 5. If significant functionality is added, there must be tests added to check this. Tests should cover all possible options. Multiple short tests are preferred over one large test. If new development on the internal JobHandler parallel system is performed, a cluster test must be added setting, in XML block, the node <internalParallel> to True.
  • 6. If the change modifies or adds a requirement or a requirement based test case, the Change Control Board's Chair or designee also needs to approve the change. The requirements and the requirements test shall be in sync.
  • 7. The merge request must reference an issue. If the issue is closed, the issue close checklist shall be done.
  • 8. If an analytic test is changed/added is the the analytic documentation updated/added?
  • 9. If any test used as a basis for documentation examples (currently found in raven/tests/framework/user_guide and raven/docs/workshop) have been changed, the associated documentation must be reviewed and assured the text matches the example.

@alfoa alfoa requested a review from wangcj05 July 21, 2023 16:09
@wangcj05
Copy link
Collaborator

@alfoa FYI
##########################################################################
ERROR: The following files contain trailing whitespace after applying your patch:
ravenframework/CodeInterfaceClasses/SCALE/ScaleInterface.py

Run the "delete_trailing_whitespace.sh" script in your $MOOSE_DIR/scripts directory.
##########################################################################

@alfoa
Copy link
Collaborator Author

alfoa commented Jul 21, 2023

@alfoa FYI ########################################################################## ERROR: The following files contain trailing whitespace after applying your patch: ravenframework/CodeInterfaceClasses/SCALE/ScaleInterface.py

Run the "delete_trailing_whitespace.sh" script in your $MOOSE_DIR/scripts directory. ##########################################################################

@wangcj05 fixed

@ In, None
@ Out, None
"""
self._data['time'] = [0.]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why time is zero here? If there is only one value for time, why do you need time in your output?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I thought that if a user uses HistorySets, RAVEN will complain because the pivot parameter (time) is not found. I can remove it if you want)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that depends on the CSAS code. Will a time-dependent outputs generated by CSAS code? If so, I think the code interface need to be revised in order to correctly process it. I would suggest to remove the time for now. @alfoa

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wangcj05 removed

@alfoa alfoa requested a review from wangcj05 July 23, 2023 23:37
@alfoa
Copy link
Collaborator Author

alfoa commented Jul 24, 2023

@wangcj05 it seems that the plugins tests time out in HERON (>6 hrs testing time)

@moosebuild
Copy link

All jobs on fed0eee : invalidated by @wangcj05

restart all tests for recent fix in test scripts.

Copy link
Collaborator

@wangcj05 wangcj05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some comments for you to review. Thanks for your contribution. @alfoa

Comment on lines 1752 to 1756
if self.isFloat:
idx = bisect.bisect(list(self.values), x)
pdfValue = self.mapping[list(self.values)[idx]]
else:
self.raiseAnError(IOError,'Categorical distribution cannot calculate pdf for ' + str(x))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alfoa These lines of code are not clear to me. I think the bisect will work only for sorted list, for example the bisect for unsorted list:
image

In addition, thanks for the updates on the extension of outcome, they can be either float or string, it seems our code only accept float values, however, I think there are several other places that you also need to make changes, such as "ppf"method, currently it only return float values, "cdf" method still require it to be float, and our manual also need to be updated if we extend it to string value. Could you make those changes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@moosebuild
Copy link

Job Test mac on fed0eee : invalidated by @wangcj05

Timeout tests/framework/ROM/TimeSeries/ARMA/ZeroFilter

@moosebuild
Copy link

Job Test mac on fed0eee : invalidated by @wangcj05

set python environment issue

@moosebuild
Copy link

Job Test qsubs sawtooth on ec78e32 : invalidated by @alfoa

@moosebuild
Copy link

Job Test mac on ec78e32 : invalidated by @wangcj05

time out for (524F1/870) Timeout(300.05sec)tests/framework/ROM/TimeSeries/ARMA/ZeroFilter

@moosebuild
Copy link

Job Test qsubs sawtooth on ec78e32 : invalidated by @wangcj05

fetch issue

@wangcj05
Copy link
Collaborator

There is a consistently timeout for test: (524F1/870) Timeout(300.06sec)tests/framework/ROM/TimeSeries/ARMA/ZeroFilter

@moosebuild
Copy link

Job Test mac on ec78e32 : invalidated by @alfoa

@moosebuild
Copy link

Job Test qsubs sawtooth on ec78e32 : invalidated by @alfoa

@moosebuild
Copy link

Job Test qsubs sawtooth on ec78e32 : invalidated by @wangcj05

fetch issue

@alfoa
Copy link
Collaborator Author

alfoa commented Jul 31, 2023

There is a consistently timeout for test: (524F1/870) Timeout(300.06sec)tests/framework/ROM/TimeSeries/ARMA/ZeroFilter

:(

@moosebuild
Copy link

Job Test qsubs sawtooth on ec78e32 : invalidated by @joshua-cogliati-inl

Failed with Device or resource busy

@moosebuild
Copy link

Job Test mac on ec78e32 : invalidated by @alfoa

@alfoa
Copy link
Collaborator Author

alfoa commented Aug 1, 2023

There is a consistently timeout for test: (524F1/870) Timeout(300.06sec)tests/framework/ROM/TimeSeries/ARMA/ZeroFilter

@wangcj05 this MR doesn't touch anything that should affect the ARMA. ARMA uses Normal and Multivariate distributions that are not impacted on my Categorical distribution changes.

@moosebuild
Copy link

Job Test mac on ec78e32 : invalidated by @alfoa

Try again. ARMA is time-outing

removed un-used imports
@moosebuild
Copy link

Job Test qsubs sawtooth on 946178f : invalidated by @alfoa

@alfoa
Copy link
Collaborator Author

alfoa commented Aug 3, 2023

There is a consistently timeout for test: (524F1/870) Timeout(300.06sec)tests/framework/ROM/TimeSeries/ARMA/ZeroFilter

@wangcj05 this MR doesn't touch anything that should affect the ARMA. ARMA uses Normal and Multivariate distributions that are not impacted on my Categorical distribution changes.

@wangcj05 can you advice on the issue with ARMI zeroFiltering test?

@moosebuild
Copy link

Job Test qsubs sawtooth on 946178f : invalidated by @alfoa

@moosebuild
Copy link

Job Test qsubs sawtooth on 946178f : invalidated by @wangcj05

fetch failed

Comment on lines +1661 to 1670
try:
float(outcome)
self.isFloat = True
except:
self.isFloat = False
if outcome in self.values:
self.raiseAnError(IOError,'Categorical distribution has identical outcomes')
else:
self.values.add(float(outcome))
self.values.add(float(outcome) if self.isFloat else outcome)
else:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alfoa: This is a general comment, and do not need to address in this PR:

The assumption here is that the users can either provide float or string outcomes. If in the inputs, there are mixed floats and strings, the current implementation can not catch it, and an unexpected crash will happen. I would suggest add a check here to make sure the inputs are either all floats or all string values.

Copy link
Collaborator

@wangcj05 wangcj05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR looks good, and I have left one general comments for you to consider.

@wangcj05
Copy link
Collaborator

wangcj05 commented Aug 6, 2023

@alfoa: In addition, there is an issue with Mac test which is not related to this PR.

@moosebuild
Copy link

Job Test mac on 946178f : invalidated by @wangcj05

@wangcj05
Copy link
Collaborator

wangcj05 commented Aug 8, 2023

@alfoa FYI, we have fixed the issue in Mac test machine. For this week, Sawtooth is under maintenance. Please let us know if you want this PR to be merged before that.

@alfoa
Copy link
Collaborator Author

alfoa commented Aug 8, 2023

@alfoa FYI, we have fixed the issue in Mac test machine. For this week, Sawtooth is under maintenance. Please let us know if you want this PR to be merged before that.

@wangcj05 there is no rush. We can wait next week (we will need this feature ~7/10 days from now). I will also address your additional comment (you are right there can be a very bad crash hehe..I ll address it :) thanks a lot )

@joshua-cogliati-inl
Copy link
Contributor

If we do merge it while sawtooth is down, make sure to manually run: ./developer_tools/pylint_check and ./doc/make_docs.sh to check that those work with the pull request.

@wangcj05
Copy link
Collaborator

wangcj05 commented Aug 8, 2023

@joshua-cogliati-inl Once sawtooth is back and the tests are green, you can merge it.

@moosebuild
Copy link

Job Test qsubs sawtooth on 946178f : invalidated by @wangcj05

@joshua-cogliati-inl joshua-cogliati-inl merged commit 87626d6 into devel Aug 9, 2023
@joshua-cogliati-inl joshua-cogliati-inl deleted the alfoa/scale_interface_augmentation branch August 9, 2023 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TASK] SCALE CSAS sequence addition
5 participants