Skip to content

Commit

Permalink
Merge branch 'master' into gamma_ray_propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewfullard committed Apr 14, 2022
2 parents 52efdc2 + 929b0ec commit 5ae327b
Show file tree
Hide file tree
Showing 184 changed files with 8,837 additions and 1,708 deletions.
54 changes: 26 additions & 28 deletions .azure-pipelines/update-refdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,55 +17,53 @@ pr:

variables:
system.debug: false
commit.sha: '$(Build.SourceVersion)'
pr.number: '$(System.PullRequest.PullRequestNumber)'
build.id: '$(Build.BuildId)'
job.id: '$(System.JobId)'
log.url: 'https://dev.azure.com/tardis-sn/TARDIS/_build/results?buildId=$(build.id)&view=logs&jobId=$(job.id)'

pool:
vmImage: 'ubuntu-latest'

jobs:
- job: 'push'
- job: 'pull_request'
steps:
- template: templates/default.yml
parameters:
fetchRefdata: true
refdataRepo: 'github'
useMamba: true

- bash: |
cd $(refdata.dir)
git remote add fork https://$(bot_token)@github.com/tardis-bot/tardis-refdata
git checkout -B pr-$(pr.number)
displayName: 'Set up new branch'
- bash: |
cd $(tardis.dir)
source activate tardis
pytest tardis --tardis-refdata=$(refdata.dir) --generate-reference
displayName: 'Generate reference data'
displayName: 'Generate reference data on a new branch'
- bash: |
cd $(refdata.dir)
git add unit_test_data.h5 montecarlo_1e5_compare_data.h5
git add -A
git config --local user.email "[email protected]"
git config --local user.name "tardis-bot"
git commit -m "update reference data (pr $(pr.number))"
git remote set-url origin https://$(bot_token)@github.com/tardis-sn/tardis-refdata
git push origin master
displayName: 'Push new reference data'
git commit -m "Automated Update (PR $(pr.number))"
git push fork pr-$(pr.number) -f
displayName: 'Commit new reference data'
- bash: |
cd $(refdata.dir)
# Check if pull request already exists
STATE=$(gh pr list --repo tardis-sn/tardis-refdata -H pr-$(pr.number) --json state | jq -r .[].state)
if [[ ! -z "$STATE" ]]; then
echo "$(bot_token)" | gh auth login --with-token
gh pr create --repo tardis-sn/tardis-refdata --head tardis-bot:pr-$(pr.number) --title "Automated Update (PR $(pr.number))" --body "_Pull request automatically generated by [#$(pr.number)](https://github.com/tardis-sn/tardis/pull/$(pr.number))_"
# Run only if the pipeline is triggered by a pull request.
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- task: GitHubComment@0
inputs:
gitHubConnection: 'tardis-sn'
repositoryName: 'tardis-sn/tardis'
id: $(pr.number)
comment: '**Update succeeded** $(commit.sha) <br><br> Changes pushed to [tardis-sn/tardis-refdata](/tardis-sn/tardis-refdata).'
displayName: 'Post results (success)'
else
exit 0
- task: GitHubComment@0
inputs:
gitHubConnection: 'tardis-sn'
repositoryName: 'tardis-sn/tardis'
id: $(pr.number)
comment: '**Update failed** $(commit.sha) <br><br> For more information, check the [job log]($(log.url)).'
displayName: 'Post results (failed)'
condition: failed()
fi
displayName: 'Propose changes via pull request'
2 changes: 1 addition & 1 deletion .github/workflows/black-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
python-version: 3.x

- name: Install Black
run: pip install black
run: pip install black==21.12b0

- name: Run Black
run: black --check tardis
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
*.o
*.so
__pycache__
docs/io/output/plasma_graph_default.tex
docs/io/output/plasma_graph_scaled.tex
docs/io/output/plasma_graph_no_eq.tex
docs/io/output/plasma_graph_with_args.tex


# Ignore .c files by default to avoid including generated code. If you want to
# add a non-generated .c extension, use `git add -f filename.c`.
Expand All @@ -20,10 +25,12 @@ MANIFEST
# Sphinx
docs/api
docs/_build
docs/ZENODO.rst
docs/resources/ZENODO.rst
docs/tutorials.rst
docs/io/configuration/components/models/converters/density_parse.csv
docs/io/configuration/components/models/converters/abund_parse.csv
docs/io/configuration/components/models/converters/rebinned_snapshot_converted_to_tardis.csvy
docs/io/configuration/components/models/converters/snapshot_converted_to_tardis.csvy

# Eclipse editor project files
.project
Expand Down
6 changes: 6 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Adam Suban-Loewen <[email protected]>

Alexander Holas <[email protected]>
Alexander Holas <[email protected]> AlexHls <[email protected]>
Alexander Holas <[email protected]> AlexHls <[email protected]>

Alice Harpole <[email protected]>
Alice Harpole <[email protected]> Alice Harpole <[email protected]>

Expand Down Expand Up @@ -106,6 +110,8 @@ Maryam Patel <[email protected]> maryam <[email protected]>
Maryam Patel <[email protected]> maryam patel <[email protected]>
Maryam Patel <[email protected]> maryampatel <[email protected]>

Matthew Bartnik <[email protected]>

Michael Klauser <[email protected]>
Michael Klauser <[email protected]> Michael.Klauser <[email protected]>
Michael Klauser <[email protected]> Michael <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ As members of the community,

This code of conduct has been adapted from the Astropy Code of Conduct, which in turn uses parts of the PSF code of conduct.

**To report any violations of the code of conduct, please contact a member of the [TARDIS core team](https://tardis-sn.github.io/tardis/team_and_governance/team.html) (the email [email protected] is monitored by the core team) or the Ombudsperson (see the [team page](https://tardis-sn.github.io/tardis/team_and_governance/team.html); who is outside of the TARDIS collaboration and will treat reports confidentially).**
**To report any violations of the code of conduct, please contact a member of the [TARDIS core team](https://tardis-sn.github.io/team/community_roles/index.html) (the email [email protected] is monitored by the core team) or the Ombudsperson (see the [team page](https://tardis-sn.github.io/team/community_roles/index.html); who is outside of the TARDIS collaboration and will treat reports confidentially).**
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@ Please make sure that you provide all the necessary information requested by pro

There is always a scope of improvement in documentation to add some missing information or to make it easier for reading. And here lies an opportunity for you, since you can edit the documentation page you want which is stored as a text file in [`docs`](https://github.com/tardis-sn/tardis/tree/master/docs) directory of TARDIS.

After editing the file locally, build the docs as described in [these instructions](https://tardis-sn.github.io/tardis/development/documentation_guidelines.html#building-documentation-locally) and then you can submit your changes to us by making a patch as described in the next section.
After editing the file locally, build the docs as described in [these instructions](https://tardis-sn.github.io/tardis/contributing/development/documentation_guidelines.html#building-documentation-locally) and then you can submit your changes to us by making a patch as described in the next section.

### Making a Patch

If you have peeked in our codebase and realized how you can fix a problem or if you know how to add a new feature, well done! If not, don't worry - just pick an [easy](https://github.com/tardis-sn/tardis/labels/easy) or [good-first](https://github.com/tardis-sn/tardis/labels/good%20first%20issue) issue and get started to fix it.

To contribute your code to TARDIS, you'll need to make a [pull request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests) from your fork of TARDIS repository. This development workflow using Git may look daunting at first, but it is not if you follow [this guide](https://tardis-sn.github.io/tardis/development/git_workflow.html#preparation-and-working-with-git) that we have prepared for you.
To contribute your code to TARDIS, you'll need to make a [pull request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests) from your fork of TARDIS repository. This development workflow using Git may look daunting at first, but it is not if you follow [this guide](https://tardis-sn.github.io/tardis/contributing/development/git_workflow.html#preparation-and-working-with-git) that we have prepared for you.

When you make a pull request, please provide all the necessary information requested by prompts in the pull request body. Also, make sure that the code you're submitting always accounts for the following three:

- **Maintaining code quality:** Your code must follow the PEP8 style guide, should cover edge cases, etc. Check our [code quality guidelines](https://tardis-sn.github.io/tardis/development/code_quality.html) for more details.
- **Documenting the code:** You must write docstrings in functions/classes, put a relevant example in TARDIS docs and make sure docs get built correctly. This is explained in detail in our [documentation guidelines](https://tardis-sn.github.io/tardis/development/documentation_guidelines.html).
- **Testing the code:** There should be unit-tests for most of the functions/methods and they must pass our testing framework. To run test locally, you can follow [this guide](https://tardis-sn.github.io/tardis/development/running_tests.html).
- **Maintaining code quality:** Your code must follow the PEP8 style guide, should cover edge cases, etc. Check our [code quality guidelines](https://tardis-sn.github.io/tardis/contributing/development/code_quality.html) for more details.
- **Documenting the code:** You must write docstrings in functions/classes, put a relevant example in TARDIS docs and make sure docs get built correctly. This is explained in detail in our [documentation guidelines](https://tardis-sn.github.io/tardis/contributing/development/documentation_guidelines.html).
- **Testing the code:** There should be unit-tests for most of the functions/methods and they must pass our testing framework. To run test locally, you can follow [this guide](https://tardis-sn.github.io/tardis/contributing/development/running_tests.html).

### Spreading the word of mouth

If you find TARDIS helpful, you can share it with your peers, colleagues, and anyone who can benefit from TARDIS. If you've used TARDIS in your research, please make sure to cite us (https://tardis-sn.github.io/tardis/credits.html). By telling other people about how we helped you, you'll help us in turn, in extending our impact. And we would absolutely love it if you give us a shout-out on [twitter](https://twitter.com/tardis_sn/)!
If you find TARDIS helpful, you can share it with your peers, colleagues, and anyone who can benefit from TARDIS. If you've used TARDIS in your research, please make sure to cite us (https://tardis-sn.github.io/tardis/resources/credits.html). By telling other people about how we helped you, you'll help us in turn, in extending our impact. And we would absolutely love it if you give us a shout-out on [twitter](https://twitter.com/tardis_sn/)!

## What if I need help?

Expand Down
1 change: 0 additions & 1 deletion docs/CHANGELOG.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/CODE_OF_CONDUCT.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/CONTRIBUTING.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
exclude_patterns.append("_templates")
exclude_patterns.append("_build")
exclude_patterns.append("**.ipynb_checkpoints")
exclude_patterns.append("research/research_done_using_TARDIS/ads.ipynb")
exclude_patterns.append("resources/research_done_using_TARDIS/ads.ipynb")

# This is added to the end of RST files - a good place to put substitutions to
# be used globally.
Expand Down Expand Up @@ -345,7 +345,7 @@ def generate_ZENODO(app):
"""Creating ZENODO.rst
Adapted from: https://astrodata.nyc/posts/2021-04-23-zenodo-sphinx/"""
CONCEPT_DOI = "592480" # See: https://help.zenodo.org/#versioning
zenodo_path = pathlib.Path("ZENODO.rst")
zenodo_path = pathlib.Path("resources/ZENODO.rst")

try:
headers = {"accept": "application/x-bibtex"}
Expand Down
1 change: 1 addition & 0 deletions docs/contributing/CHANGELOG.md
1 change: 1 addition & 0 deletions docs/contributing/CONTRIBUTING.md
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ When making or adding changes to the functionality of an aspect of TARDIS, an ``
RST Documentation
-----------------

Documentation not featuring interactive code examples is written in Sphinx's reStructuredText (see `here <https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html>`_). Files written in reStructuredText have a ``.rst`` file extension, and are then built as HTML filed by Sphinx during the documentation build. Only the RST file, not the built HTML file, are committed to the repository. Documentation should be clear and concise. See :doc:`../io/visualization/using_widgets` as a good example of an RST-generated page.
Documentation not featuring interactive code examples is written in Sphinx's reStructuredText (see `here <https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html>`_). Files written in reStructuredText have a ``.rst`` file extension, and are then built as HTML filed by Sphinx during the documentation build. Only the RST file, not the built HTML file, are committed to the repository. Documentation should be clear and concise. See :doc:`../../io/visualization/using_widgets` as a good example of an RST-generated page.


IPYNB Documentation
-------------------

Often, code examples can help explain concepts better. The TARDIS utilizes `Jupyter notebooks <https://jupyter.org/>`_ (``.ipynb`` file extension) to demonstrate features of the code package within our documentation. See :doc:`../quickstart/quickstart` or :doc:`../physics/montecarlo/initialization` for good examples.
Often, code examples can help explain concepts better. The TARDIS utilizes `Jupyter notebooks <https://jupyter.org/>`_ (``.ipynb`` file extension) to demonstrate features of the code package within our documentation. See :doc:`../../quickstart` or :doc:`../../physics/montecarlo/initialization` for good examples.

TARDIS uses the `nbsphinx <https://nbsphinx.readthedocs.io/>`_ extension to turn these notebooks into HTML pages in the documentation. During a documentation build, nbsphinx runs all notebooks in the documentation with cleared output and places their output in the HTML. **Thus, notebook output must always be cleared before it is submitted** to ensure that the notebooks are run by nbsphinx. Running these notebooks during the documentation build helps ensure that the documentation is kept up-to-date, as notebook output will reflect the current state of the TARDIS code. Additionally, if updates in the code are inconsistent with the documentation, the documentation build will return an error, alerting TARDIS developers to the inconsistency.

An added benefit of IPYNB documentation is the ability to have interactive tutorials. All notebooks in the TARDIS documentation feature a button at the top encouraging users to launch the interactive version of the notebook (see the previously mentioned examples). This directs users to the TARDIS repository on `Binder <https://mybinder.org/>`_, where the notebook can be run using an online Jupyter kernel. Additionally, all notebooks in the Input/Output section of the documentation are automatically linked to on the :doc:`../tutorials` page.
An added benefit of IPYNB documentation is the ability to have interactive tutorials. All notebooks in the TARDIS documentation feature a button at the top encouraging users to launch the interactive version of the notebook (see the previously mentioned examples). This directs users to the TARDIS repository on `Binder <https://mybinder.org/>`_, where the notebook can be run using an online Jupyter kernel. Additionally, all notebooks in the Input/Output section of the documentation are automatically linked to on the :doc:`../../tutorials` page.


Including Your Page in the TARDIS Documentation
Expand All @@ -37,8 +37,8 @@ Including Your Page in the TARDIS Documentation
Whether your page is written in reStructuredText or as a Jupyter notebook, it must be included in the TARDIS documentation. This has three steps:

1. Determine the appropriate location for the page within the documentation. Feel free to reach out to someone in the TARDIS collaboration for help with this step.
2. Place your file in the corresponding directory in the ``docs/`` directory of the repository. For example, the :doc:`../io/visualization/using_widgets` is a subpage of "Visualization Tools and Widgets" under the Input/Output section of the documentation, so it is placed in ``docs/io/visualization/``.
3. Include your file in the/a `toctree <https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-toctree>`_ of the corresponding ``index.rst``. For example, :doc:`../io/visualization/using_widgets` was included in a toctree of ``docs/io/visualization/index.rst``.
2. Place your file in the corresponding directory in the ``docs/`` directory of the repository. For example, the :doc:`../../io/visualization/using_widgets` is a subpage of "Visualization Tools and Widgets" under the Input/Output section of the documentation, so it is placed in ``docs/io/visualization/``.
3. Include your file in the/a `toctree <https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-toctree>`_ of the corresponding ``index.rst``. For example, :doc:`../../io/visualization/using_widgets` was included in a toctree of ``docs/io/visualization/index.rst``.

.. note::

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Preparation and Working with Git
================================

In this document, we refer to the TARDIS ``master`` branch as the *trunk*. The first step is to setup up a python environment. We recommend using
Anaconda for this purpose; refer to our :doc:`Installation guide <../installation>` which covers this topic.
Anaconda for this purpose; refer to our :doc:`Installation guide <../../installation>` which covers this topic.

.. _forking:

Expand Down Expand Up @@ -364,6 +364,8 @@ To make sure that your changes are still working on the new master, you want to
*rebase* your branch on top of the evolved master.


.. _rebase-on-trunk:

Rebasing on trunk
^^^^^^^^^^^^^^^^^

Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions docs/contributing/development/profiling/tardis_example.yml
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ tests, you can run this with:

.. code-block:: shell
> python setup.py test
> pytest tardis
Running the more advanced unit tests requires TARDIS Reference data that can be
Expand All @@ -32,7 +32,7 @@ downloaded

.. code-block:: shell
> python setup.py test --args="--tardis-refdata=/path/to/tardis-refdata/"
> pytest tardis --tardis-refdata=/path/to/tardis-refdata/
Generating Plasma Reference
===========================
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ If you think your could be dealing with scenario B, then:
.. note::

- If you don't have enough privileges to run the pipelines, tag a TARDIS developer capable of doing so.
- If any of these two pipelines fail, please tag the :ref:`CI/CD responsible <team>`.
- If any of these two pipelines fail, please tag a `TARDIS team member <https://tardis-sn.github.io/team/community_roles/>`_ responsible for CI/CD.

If everything went well, the reference data will have been updated by the TARDIS bot and the commit
message should include the pull request number that triggered the update.
Expand Down
File renamed without changes.
Binary file added docs/graphics/dilution_factor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/graphics/esa.png
Binary file not shown.
Binary file removed docs/graphics/github.png
Binary file not shown.
Binary file removed docs/graphics/google.png
Binary file not shown.
Binary file removed docs/graphics/numfocus.png
Binary file not shown.
Loading

0 comments on commit 5ae327b

Please sign in to comment.