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

Mandd/gawithcustomsampler #2084

Merged
merged 8 commits into from
Feb 28, 2023
Merged

Mandd/gawithcustomsampler #2084

merged 8 commits into from
Feb 28, 2023

Conversation

mandd
Copy link
Collaborator

@mandd mandd commented Feb 24, 2023


Pull Request Description

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

Closes #2060

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

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.

@mandd
Copy link
Collaborator Author

mandd commented Feb 24, 2023

@aalfonsi this PR addresses your issue #2060

@aalfonsi
Copy link
Collaborator

Thanks a lot!

@moosebuild
Copy link

Job Test Fedora 31 on 36d81f6 : invalidated by @mandd

@moosebuild
Copy link

Job Test Ubuntu 18-2 Python 3 on 36d81f6 : invalidated by @mandd

1 similar comment
@moosebuild
Copy link

Job Test Ubuntu 18-2 Python 3 on 36d81f6 : invalidated by @mandd

@@ -106,7 +107,9 @@ def getpotToInputTree(getpot):
#------------------
# attributes and values
elif '=' in line:
print('HERE')
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed, edit for a different issue

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 a coupe of minor comments for you to consider. @mandd

attribute, value = (x.strip() for x in line.split('=', maxsplit=1))
print(attribute, value)
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed, edit for a different issue

@@ -124,6 +127,7 @@ def getpotToInputTree(getpot):
# DO NOT continue, keep going until multiline is closed
continue
else:
print('HERE1')
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed, edit for a different issue

@@ -208,7 +208,8 @@ def _localGenerateAssembler(self, initDict):
self.assemblerDict['DataObjects'] = []
self.assemblerDict['Distributions'] = []
self.assemblerDict['Functions'] = []
for mainClass in ['DataObjects', 'Distributions', 'Functions']:
self.assemblerDict['Files'] = []
for mainClass in ['DataObjects', 'Distributions', 'Functions', 'Files']:
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe define a validAssembler list which can be used in multiple places.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added

<objective>ans</objective>
<TargetEvaluation class="DataObjects" type="PointSet">optOut</TargetEvaluation>
<Sampler class="Samplers" type="CustomSampler">restartSampler</Sampler>
<!--Sampler class="Samplers" type="MonteCarlo">MC_samp</Sampler-->
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

Comment on lines 109 to 123
<MonteCarlo name="MC_samp">
<samplerInit>
<limit>10</limit>
<initialSeed>20021986</initialSeed>
</samplerInit>
<variable name="x1">
<distribution>uniform_dist_Repl_1</distribution>
</variable>
<variable name="x2">
<distribution>uniform_dist_Repl_1</distribution>
</variable>
<variable name="x3">
<distribution>uniform_dist_Repl_1</distribution>
</variable>
</MonteCarlo>
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove? Not used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@moosebuild
Copy link

Job Test mac on 0473401 : invalidated by @mandd

@moosebuild
Copy link

Job Test CentOS 7 on 0473401 : invalidated by @mandd

@@ -401,7 +405,7 @@ def _initializeInitSampler(self, externalSeeding):
self._initSampler = sampler
# initialize sampler
samplerInit = {}
for entity in ['Distributions', 'Functions', 'DataObjects']:
for entity in ['Distributions', 'Functions', 'DataObjects','Files']:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you change the list to use self.optAssemblerList here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch

Comment on lines 240 to 243
needDict['Distributions'] = [(None,'all')]
needDict['Functions' ] = [(None,'all')]
needDict['DataObjects' ] = [(None,'all')]
needDict['Files' ] = [(None,'all')]
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems we can do a loop over self.optAssemblerList here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good point

@moosebuild
Copy link

Job Test Ubuntu 16 on 0040e2a : invalidated by @mandd

Comment on lines 242 to 245
#needDict['Distributions'] = [(None,'all')]
#needDict['Functions' ] = [(None,'all')]
#needDict['DataObjects' ] = [(None,'all')]
#needDict['Files' ] = [(None,'all')]
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove these lines?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sorry

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

doing too many things at the same time

wangcj05
wangcj05 previously approved these changes Feb 27, 2023
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.

changes look good.

@wangcj05
Copy link
Collaborator

Once tests are green, this PR can be merged.

@moosebuild
Copy link

Job Mingw Test on 7a31828 : invalidated by @wangcj05

fetch failed

@moosebuild
Copy link

Job Mingw Test on 7a31828 : invalidated by @joshua-cogliati-inl

failed in fetch

@moosebuild
Copy link

Job Mingw Test on 7a31828 : invalidated by @mandd

@moosebuild
Copy link

Job Mingw Test on 7a31828 : invalidated by @wangcj05

failed InterpolatedMaxCycles

@moosebuild
Copy link

Job Mingw Test on 7a31828 : invalidated by @mandd

@wangcj05
Copy link
Collaborator

@mandd I guess there is a consistent failure in Windows, which is caused by test InterpolatedMaxCycles. This test has been recently revived in PR#2035. The purpose of the test is test the validity of input structure for ARMA, it is not made for consistent check.

image

I recommend to increase the rel_err for this test or we do not check the consistency in the csv file, just checkout it produces csv files.

@joshua-cogliati-inl
Copy link
Contributor

@mandd I guess there is a consistent failure in Windows, which is caused by test InterpolatedMaxCycles. This test has been recently revived in PR#2035. The purpose of the test is test the validity of input structure for ARMA, it is not made for consistent check.

image

I recommend to increase the rel_err for this test or we do not check the consistency in the csv file, just checkout it produces csv files.

I agree, change "csv =" to "output =" in this test.

@wangcj05
Copy link
Collaborator

PR looks good and checklist is satisfied.

@wangcj05 wangcj05 merged commit 0309b51 into devel Feb 28, 2023
@wangcj05 wangcj05 deleted the mandd/GAwithCustomsampler branch February 28, 2023 23:54
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.

[DEFECT] Optimizers cannot be "initialized" with CustomSampler <Source> Files
5 participants