-
Couldn't load subscription status.
- Fork 29
Full Integration Tests #295
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
50c7511
added test_full.py
orbitfold 32f7f7b
added scanalysis to test_full
orbitfold 6c92296
updates to test_full_campaign
orbitfold 6d28fc2
revert back change in test_campaign
orbitfold 21bb203
added qmc to the list
orbitfold ca59500
Merge branch 'dev' into test-full
djgroen 8a776fc
Merge branch 'dev' into test-full
DavidPCoster 83bb7bb
Merge branch 'dev' into test-full
djgroen b813777
Merge branch 'dev' into test-full
DavidPCoster f945806
follow suggestsions by Code scanning / CodeQL and Maziar
DavidPCoster ac9b714
Merge branch 'dev' into test-full
DavidPCoster b286c00
some changes to get it to work ...
DavidPCoster File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| import os | ||
| import easyvvuq as uq | ||
| from easyvvuq.actions import CreateRunDirectory, Encode, Decode, ExecuteLocal, Actions | ||
| import chaospy as cp | ||
| import pytest | ||
| import itertools | ||
| import tempfile | ||
|
|
||
| @pytest.mark.parametrize( | ||
| 'encoder,decoder,sampler_analysis', | ||
| itertools.product( | ||
| [uq.encoders.GenericEncoder( | ||
| template_fname='tests/cooling/cooling.template', | ||
| delimiter='$', | ||
| target_filename='cooling_in.json')], | ||
| [uq.decoders.SimpleCSV( | ||
| target_filename='output.csv', | ||
| output_columns=['te']), | ||
| uq.decoders.JSONDecoder( | ||
| target_filename='output.json', | ||
| output_columns=['te'])], | ||
| [(uq.sampling.PCESampler, uq.analysis.PCEAnalysis), | ||
| (uq.sampling.SCSampler, uq.analysis.SCAnalysis), | ||
| (lambda vary: uq.sampling.QMCSampler(vary, 25), uq.analysis.QMCAnalysis)])) | ||
|
|
||
| def test_full_campaign(encoder, decoder, sampler_analysis): | ||
| with tempfile.TemporaryDirectory() as tmp_path: | ||
| params = { | ||
| "temp_init": { | ||
| "type": "float", | ||
| "min": 0.0, | ||
| "max": 100.0, | ||
| "default": 95.0}, | ||
| "kappa": { | ||
| "type": "float", | ||
| "min": 0.0, | ||
| "max": 0.1, | ||
| "default": 0.025}, | ||
| "t_env": { | ||
| "type": "float", | ||
| "min": 0.0, | ||
| "max": 40.0, | ||
| "default": 15.0}, | ||
| "out_file": { | ||
| "type": "string", | ||
| "default": "output.csv" | ||
| } | ||
| } | ||
| vary = { | ||
| "kappa": cp.Uniform(0.025, 0.075), | ||
| "t_env": cp.Uniform(15, 25) | ||
| } | ||
| sampler, analysis = sampler_analysis | ||
| sampler = sampler(vary) | ||
| analysis = analysis(sampler, qoi_cols=['te']) | ||
| execute = ExecuteLocal(os.path.abspath("tests/cooling/cooling_model.py") + " cooling_in.json") | ||
| actions = Actions(CreateRunDirectory(root='/tmp'), Encode(encoder), execute, Decode(decoder)) | ||
| campaign = uq.Campaign( | ||
| name='test_campaign', work_dir=tmp_path, db_location='sqlite:///:memory:') | ||
| campaign.add_app(name='test_app', params=params, actions=actions) | ||
| campaign.set_sampler(sampler) | ||
| campaign.execute().collate() | ||
| df = campaign.get_collation_result() | ||
| result = analysis.analyse(df) | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check notice
Code scanning / CodeQL
Unused local variable Note test