-
Notifications
You must be signed in to change notification settings - Fork 6
Add post-processing step for a grid and generate grid plot #423
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
Open
EmmaPostolec
wants to merge
133
commits into
main
Choose a base branch
from
ep/post_processing_grid
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
133 commits
Select commit
Hold shift + click to select a range
093a257
Change in escape/wrapper.py to put a warning if M_vols too low
1da9cb2
Merge branch 'main' into ep/bug_escape
EmmaPostolec 13d9272
Minor doc update
EmmaPostolec ff6bae5
Add toi561b toml file in input/planets
EmmaPostolec 3ce1066
toi561b toml file
EmmaPostolec 7112343
update
EmmaPostolec f426496
Add the post_processing_grid.py script and create a new folder to tes…
EmmaPostolec 22e7fd9
Add histo plot
EmmaPostolec cc4cac9
Move post_processing_grid folder to tools
EmmaPostolec e6c59ed
try to do plot function : fail
EmmaPostolec 8607942
Try to save extracted data in a csv file : still working on it
EmmaPostolec c944fcb
Save into csv ok now need to clean script
EmmaPostolec c453f46
post processing grid : generate csv file and then single plots. still…
EmmaPostolec 2bacac7
try for grid plot. need to fix log single plots
EmmaPostolec 06a68e8
Merge branch 'main' into ep/post_processing_grid
EmmaPostolec 36858ca
Clean and clear comment in post_processing_grid.py
EmmaPostolec f3dc067
clean plot_grid.py
EmmaPostolec 62057ea
Minor update to make it work fro another grid
EmmaPostolec abec185
Merge branch 'main' into ep/post_processing_grid
EmmaPostolec bc38fe1
Update toi561b.toml with johanna updated value in green in the table
EmmaPostolec 493e68a
maybe i fixed the log scale problem youhou
EmmaPostolec 63b3022
Almost there with log plots still needs to fix pb
EmmaPostolec d768f6b
Merge branch 'main' into ep/post_processing_grid
EmmaPostolec a04154d
Merge branch 'main' into ep/post_processing_grid
EmmaPostolec f35b076
test vs code commit
EmmaPostolec ed4b02e
minor changes
EmmaPostolec a361a7a
Merge branch 'main' into ep/post_processing_grid
EmmaPostolec 0d44975
Merge branch 'main' into ep/post_processing_grid
EmmaPostolec c000b1a
small test to have consistent plot
EmmaPostolec 2abe169
try to fix error log : now using ecdfplot for a single plot and its w…
EmmaPostolec d116058
clean a bit plot_grid.py
EmmaPostolec 35779ea
plot for solidification time ok save before looping on all output
EmmaPostolec 551d0cf
Single plots for all input param and output OK
EmmaPostolec 7c93ab5
plot grid ok !!!
EmmaPostolec bbd119f
latest change before update main
EmmaPostolec 2791d9b
Merge branch 'main' into ep/post_processing_grid
EmmaPostolec e8e2a2b
re-organize the code for easier use
EmmaPostolec 02058b3
Merge branch 'main' into ep/post_processing_grid
EmmaPostolec bf4c5af
remove all files related to this branch from tools/
EmmaPostolec 2077467
re-organize output + try to fix grid plot
EmmaPostolec dea5298
grid plot ok :)
EmmaPostolec 38f65f4
extract more outpout from grid and test plots for different outpouts
EmmaPostolec 598e6da
creating the proteus grid-analyze command and it worked yeah
EmmaPostolec d6a07ab
update doc with the proteus grid-analyze command
EmmaPostolec 4cd918f
add the csv_error_cases but still need to work on this
EmmaPostolec f389ccb
commit by copilot ai : Update src/proteus/cli.py base
EmmaPostolec c2d8bcb
commit by copilot ai : Update input/planets/toi561b.toml
EmmaPostolec 1573e04
commit copilot ai : Update docs/usage.md
EmmaPostolec 408a6ef
commit copilot AI : Update docs/usage.md
EmmaPostolec 0f07412
move the big run_grid_analyze funciton to the run_analysis_grid.py sc…
EmmaPostolec f8eb629
update_docs
EmmaPostolec ed410f1
try to fix the test
EmmaPostolec 2f076d4
add pkl to gitignore
EmmaPostolec 1c698f9
add seaborn as a dependency in pyproject.toml
EmmaPostolec fb2a907
Fix pre-commit hook issues: trailing whitespace, end-of-file, ruff
EmmaPostolec c0db852
try to fix cide style to pass the tests
EmmaPostolec 2eca57e
fix import cm
EmmaPostolec 2280407
input file to run toi561b grids + addition of tested parameters for t…
EmmaPostolec 14f244c
resolve merge conflict before merging main
EmmaPostolec cb1b177
update input and grid submission files with latest main updates
EmmaPostolec 9d8d21d
update files for more efficient grid runs
EmmaPostolec 8b2be29
minor change toml files for grid runs
EmmaPostolec 8a25af0
changes for toi561b grid with correct stellar spectrum
EmmaPostolec fcf8c67
need to run the grid paper 1 and toi561b
EmmaPostolec 581e554
update to fix stellar spectrum error with janus
EmmaPostolec 9d1e4a8
Merge branch 'main' into ep/post_processing_grid
EmmaPostolec 1bc0839
Merge branch 'main' into ep/post_processing_grid
EmmaPostolec dec87d2
Merge branch 'main' into ep/post_processing_grid
EmmaPostolec 06a43f9
Merge branch 'ep/janus_fix_escape' into ep/post_processing_grid
EmmaPostolec 372c24d
Merge branch 'ep/janus_fix_escape' into ep/post_processing_grid
EmmaPostolec 26bd0e3
Merge branch 'ep/janus_fix_escape' into ep/post_processing_grid
EmmaPostolec 5f0f6e3
Merge branch 'main' into ep/post_processing_grid
EmmaPostolec 5b4fa57
create a new csv file with only completed cases and add number in the…
EmmaPostolec ee39aa6
changes for plots paper 1 add ecdf species grid plot
EmmaPostolec c9ca7e4
update ecdf grid function to plot only values > 0 for species plot
EmmaPostolec 4abed76
Merge branch 'main' into ep/post_processing_grid
EmmaPostolec 3f3ab41
Merge branch 'main' into ep/post_processing_grid
EmmaPostolec 37e1b9a
Merge branch 'main' into ep/post_processing_grid
EmmaPostolec bb957c0
mini updates before mergin main
EmmaPostolec f12f309
Fix usage for merging
EmmaPostolec 2ecbd7c
test to update the post-processing script to new proteus version. nee…
EmmaPostolec 84930fc
update toi561b file and new try to update the post processing steps
EmmaPostolec 32183d4
generate csv file following harrison guidelines
EmmaPostolec 145ce1c
plot status grid ok
EmmaPostolec 6d12a53
almost there for ecdf
EmmaPostolec 3f3d641
create toml grid analyze and use it for ecdf plot, clean and update f…
EmmaPostolec 4be722a
update the command and doc
EmmaPostolec a8238f9
update minor typos
EmmaPostolec ebe169e
update doc
EmmaPostolec 48f7eb7
Merge branch 'main' into ep/post_processing_grid
EmmaPostolec 64febce
Remove folder_list file and simulations configuration files for my grid
EmmaPostolec 0c61448
Update src/proteus/grid/post_processing.py
EmmaPostolec a75fbc5
Update src/proteus/grid/post_processing.py
EmmaPostolec fa577db
update toi561b time step
EmmaPostolec 2ea72bb
Merge branch 'main' into ep/post_processing_grid
EmmaPostolec 48267f0
Merge branch 'main' into ep/post_processing_grid
EmmaPostolec 663658c
update
EmmaPostolec d54ed2a
Merge branch 'main' into ep/post_processing_grid
EmmaPostolec 99a3c83
update the generate_csv funciton to avoid redundancy as suggested by …
EmmaPostolec 08bac68
update doc of group_output_by_parameter funvtion as suggested by copilot
EmmaPostolec bf1b8fc
update doc of ecdf_grid_plot function
EmmaPostolec 91ce43a
context manager in ecdf_grid_plot to close toml file for copilot issue
EmmaPostolec 03ea9d3
update doc
EmmaPostolec df59de7
clean extra docstring in post_processing.py
EmmaPostolec d97a5bf
update docstring latex function
EmmaPostolec aefbc03
remove grid_analyse_toml_file = None by default
EmmaPostolec 5877426
typo in example.grid_analyse.toml
EmmaPostolec 9e879a9
update legend fO2 plot and update cli command to be consitent with PR…
EmmaPostolec 21b3113
update doc with latest cli changes
EmmaPostolec 25b30be
allow the user to choose the format of plot png or pdf
EmmaPostolec 134833c
remove printing statement
EmmaPostolec acf29fc
Merge branch 'main' into ep/post_processing_grid
EmmaPostolec 92348f6
update grid path from same config file and add preset_labels
EmmaPostolec 36dcf4b
update the label for plotting
EmmaPostolec 2651831
trying to get input param from grid config file
EmmaPostolec 3bfaa36
update so input param are not duplicate for ecdf grid plot
EmmaPostolec 875dee9
update scale log scale preset and update post_processing so it works …
EmmaPostolec a8196a1
clean test example.toml files, update docs and create succesfull pytest
EmmaPostolec e9f2f32
ruff changes to pass tests
EmmaPostolec 04c654a
fix colormap problem
EmmaPostolec 1c51c2a
fix: read colormap from top-level cfg key and fix ruff lint in platon.py
Copilot a398c59
fix removing 0 when it shouldnt with clean_series
EmmaPostolec 10b92cd
fix mistake unit rho_obs in plot.py
EmmaPostolec 4d8fc82
update the grammar in _escape.py
EmmaPostolec c635379
update doc mistake
EmmaPostolec 77356bf
doc typo
EmmaPostolec ace2dac
comment for copilot on no argument in main
EmmaPostolec 3d84a2b
to avoid copilot warning about not passing argument to main
EmmaPostolec 5b6ce81
Merge branch 'ep/post_processing_grid' of github.com:FormingWorlds/PR…
EmmaPostolec 5738d61
typo _escape.py
EmmaPostolec 6e6ead5
ruff format on src/tests/ to pas test
EmmaPostolec 1d8978a
test: add unit tests for post_processing helper functions
Copilot e65c564
test: address code review feedback on unit tests
Copilot 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -274,3 +274,6 @@ tests/validation/ | |
| CLAUDE.md | ||
| .claude/ | ||
| .mcp.json | ||
|
|
||
| # pickle files | ||
| *.pkl | ||
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 |
|---|---|---|
|
|
@@ -172,6 +172,39 @@ Use the CLI to package the results of a grid into a zip file; e.g. for sharing o | |
| ```console | ||
| proteus grid-pack -o output/grid_demo/ | ||
| ``` | ||
| ## Postprocessing of grid results | ||
|
|
||
| Results from a PROTEUS grid can be post-processed using the `proteus grid-analyse` command. Running the analysis generates summary CSV files containing all tested input parameters and the final time-step outputs for each simulation, along with a status overview plot showing the distribution of simulation outcomes (e.g., completed, running, error) and empirical cumulative distribution function (ECDF) plots that summarize selected output variables across all completed simulations. (For more details on ECDF plots, see the [Seaborn `ecdfplot` documentation](https://seaborn.pydata.org/generated/seaborn.ecdfplot.html).) | ||
|
|
||
| Before running the command, configure the post-processing options in your grid configuration file:`input/ensembles/example.grid.toml`. The following options can be set: | ||
|
|
||
| - `update_csv` — Generate or update the CSV summary files | ||
| - `plot_format` — Output format for plots (e.g., `png`, `pdf`) | ||
| - `plot_status` — Enable/disable the status summary plot | ||
| - `plot_ecdf` — Enable/disable ECDF plot generation | ||
| - `output_variables` — List of variables to include in ECDF plots | ||
|
|
||
| > **Note:** | ||
| > The variables specified in `output_variables` must match column names in `runtime_helpfile.csv`. | ||
| > The `solidification_time` is the only variable computed during post-processing and is not directly stored in the simulation output. | ||
|
|
||
| --- | ||
|
|
||
| To post-process a grid and generate ECDF plots for further analysis, run the following command: | ||
|
|
||
| ``` | ||
| proteus grid-analyse --config input/ensembles/example.grid.toml | ||
| ``` | ||
|
|
||
|
|
||
| After execution, a `post_processing/` directory is created inside the grid folder with the following structure: | ||
|
|
||
| - `extracted_data/` This directory contains three CSV files: | ||
| - `{grid_name}_final_extracted_data_all.csv` which includes every run in the grid | ||
| - `{grid_name}_final_extracted_data_completed.csv` which contains only successful runs (used for ECDF plots) | ||
| - `{grid_name}_final_extracted_data_running_error.csv` for only failed simulations with status `Running` or `Error`. | ||
|
|
||
| - `grid_plots/` This directory contains a status summary plot and a ECDF plot | ||
|
||
|
|
||
| ## Retrieval scheme (Bayesian optimisation) | ||
|
|
||
|
|
||
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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
|---|---|---|
|
|
@@ -64,6 +64,7 @@ dependencies = [ | |
| "ruff", | ||
| "sympy", | ||
| "astropy", | ||
| "seaborn", | ||
| "torch", | ||
| "botorch", | ||
| "gpytorch", | ||
|
|
||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.