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

TARDIS Grid #1738

Merged
merged 22 commits into from
Jul 28, 2021
Merged

TARDIS Grid #1738

merged 22 commits into from
Jul 28, 2021

Conversation

marxwillia
Copy link
Contributor

Description
A new module for generating grids of TARDIS simulation parameters and functionality facilitating the running of large numbers of simulations.

Motivation and context
The grid streamlines running and saving large grids of simulation parameters. It will make it very easy to generate grids from basic uniform abundances and then modify the models in systematic ways to add complexity.

How has this been tested?

  • Testing pipeline.
  • Other.

Examples
A thorough example is in the docs under /io/grid/

Type of change

  • Bug fix.
  • New feature.
  • Breaking change.
  • None of the above.

Checklist

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
    • (optional) I have built the documentation on my fork following the instructions.
  • I have assigned and requested two reviewers for this pull request.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@tardis-bot
Copy link
Contributor

Before a pull request is accepted, it must meet the following criteria:

  • Is the necessary information provided?
  • Is this a duplicate PR?
    • If a new PR is clearly a duplicate, ask how this PR is different from the original PR?
    • If this PR is about to be merged, close the original PR with a link to this new PR that solved the issue.
  • Does it pass existing tests and are new tests provided if required?
    • The test coverage should not decrease, and for new features should be close to 100%.
  • Is the code tidy?
    • No unnecessary print lines or code comments.

@marxwillia marxwillia requested a review from wkerzendorf July 16, 2021 19:06
@andrewfullard
Copy link
Contributor

You may want to consider adding logging messages or passthrough handling for logging through run_tardis

@marxwillia
Copy link
Contributor Author

I still need to write some tests for this PR.

@codecov
Copy link

codecov bot commented Jul 16, 2021

Codecov Report

Merging #1738 (d853ec3) into master (c6d8b91) will increase coverage by 0.78%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1738      +/-   ##
==========================================
+ Coverage   61.87%   62.65%   +0.78%     
==========================================
  Files          63       65       +2     
  Lines        5852     6036     +184     
==========================================
+ Hits         3621     3782     +161     
- Misses       2231     2254      +23     
Impacted Files Coverage Δ
tardis/tardis/base.py 57.14% <0.00%> (-0.55%) ⬇️
tardis/tardis/visualization/widgets/shell_info.py 95.95% <0.00%> (-0.05%) ⬇️
tardis/tardis/io/logger/logger.py 91.80% <0.00%> (ø)
tardis/tardis/io/atom_data/base.py 89.77% <0.00%> (ø)
tardis/tardis/montecarlo/spectrum.py 65.51% <0.00%> (ø)
tardis/tardis/scripts/cmfgen2tardis.py 0.00% <0.00%> (ø)
tardis/tardis/plasma/standard_plasmas.py 73.11% <0.00%> (ø)
tardis/tardis/io/logger/montecarlo_logger.py
tardis/tardis/grid/base.py 86.27% <0.00%> (ø)
...dis/tardis/visualization/tools/convergence_plot.py 88.67% <0.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c6d8b91...d853ec3. Read the comment docs.

@marxwillia
Copy link
Contributor Author

You may want to consider adding logging messages or passthrough handling for logging through run_tardis

Added kwarg pass through so that users can specify run_tardis() kwargs.

@isaacgsmith isaacgsmith self-requested a review July 22, 2021 21:08
Copy link
Contributor

@Rodot- Rodot- left a comment

Choose a reason for hiding this comment

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

I left a few small suggestions for clarity but functionally it looks good to me

tardis/grid/base.py Outdated Show resolved Hide resolved
----------
configFile : str
path to TARDIS yml file.
gridFrame : pandas.core.frame.DataFrame
Copy link
Contributor

Choose a reason for hiding this comment

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

Possibly do some type-checking here? Could get weird if someone accidentally passes in a numpy array or a list

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it's necessary since there's effectively duck typing since the grid relies on .iloc[] for accessing rows.

"""

def __init__(self, configFile, gridFrame):
try:
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps do type-checking here rather than exceptions?

@marxwillia marxwillia merged commit a63a37b into tardis-sn:master Jul 28, 2021
DhruvSondhi pushed a commit to DhruvSondhi/tardis that referenced this pull request Aug 1, 2021
* experimental notebook

* init grid dataframe

* config changes

* added grid module

* updated test

* added docstrings

* Added grid_row_to_model() class function.

* Added docs for grid [build docs]

* [build docs]

* [build docs]

* [build docs]

* [build docs]

* added grid doc to sidebar. [build docs]

* Added tests

* black formatting

* renamed to base.py

* cleared output so notebook is run when building docs

* added kwarg pass through for run_tardis kwargs.

* Fixed docstring

Co-authored-by: Marc Williamson <[email protected]>
DhruvSondhi pushed a commit to DhruvSondhi/tardis that referenced this pull request Aug 9, 2021
* experimental notebook

* init grid dataframe

* config changes

* added grid module

* updated test

* added docstrings

* Added grid_row_to_model() class function.

* Added docs for grid [build docs]

* [build docs]

* [build docs]

* [build docs]

* [build docs]

* added grid doc to sidebar. [build docs]

* Added tests

* black formatting

* renamed to base.py

* cleared output so notebook is run when building docs

* added kwarg pass through for run_tardis kwargs.

* Fixed docstring

Co-authored-by: Marc Williamson <[email protected]>
DhruvSondhi pushed a commit to DhruvSondhi/tardis that referenced this pull request Aug 9, 2021
* experimental notebook

* init grid dataframe

* config changes

* added grid module

* updated test

* added docstrings

* Added grid_row_to_model() class function.

* Added docs for grid [build docs]

* [build docs]

* [build docs]

* [build docs]

* [build docs]

* added grid doc to sidebar. [build docs]

* Added tests

* black formatting

* renamed to base.py

* cleared output so notebook is run when building docs

* added kwarg pass through for run_tardis kwargs.

* Fixed docstring

Co-authored-by: Marc Williamson <[email protected]>
atharva-2001 pushed a commit to atharva-2001/tardis that referenced this pull request Oct 1, 2021
* experimental notebook

* init grid dataframe

* config changes

* added grid module

* updated test

* added docstrings

* Added grid_row_to_model() class function.

* Added docs for grid [build docs]

* [build docs]

* [build docs]

* [build docs]

* [build docs]

* added grid doc to sidebar. [build docs]

* Added tests

* black formatting

* renamed to base.py

* cleared output so notebook is run when building docs

* added kwarg pass through for run_tardis kwargs.

* Fixed docstring

Co-authored-by: Marc Williamson <[email protected]>
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.

4 participants