Skip to content

Commit 04f1e56

Browse files
committed
Properly fixed antiderivative / integration functionality and added Test I to test that functionality going forward.
Updated `CITATION.cff` and `CONTRIBUTING.md`. Ready to release v1.5.
1 parent b8942e7 commit 04f1e56

14 files changed

Lines changed: 438 additions & 154 deletions

CITATION.cff

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ cff-version: 1.2.0
55
title: PythonicDISORT
66
message: >-
77
If you use this software, please cite it using the
8-
metadata from this file.
8+
metadata from this file. Please also cite the JOSS paper:
9+
https://doi.org/10.21105/joss.06442
910
type: software
1011
authors:
1112
- given-names: Dion J. X.

CONTRIBUTING.md

Lines changed: 101 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,141 @@
11
<!-- omit in toc -->
22
# Contributing to PythonicDISORT
33

4-
First off, thanks for taking the time to contribute! ❤️
4+
Thanks for contributing — improvements to correctness, performance, docs, and examples are all welcome.
55

6-
All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉
7-
8-
> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
9-
> - Star the project
10-
> - Tweet about it
11-
> - Refer this project in your project's readme
12-
> - Mention the project at local meetups and tell your friends/colleagues
6+
**Quick links**
7+
- Docs: https://pythonic-disort.readthedocs.io/en/latest/
8+
- Issues: https://github.com/LDEO-CREW/Pythonic-DISORT/issues
9+
- Security concerns: email dh3065@columbia.edu (please do not open a public issue)
1310

1411
<!-- omit in toc -->
15-
## Table of Contents
12+
## Table of contents
13+
- [Getting set up](#getting-set-up)
14+
- [Running tests](#running-tests)
15+
- [Reporting bugs](#reporting-bugs)
16+
- [Requesting changes](#requesting-changes)
17+
- [Contributing code](#contributing-code)
18+
- [Improving documentation and notebooks](#improving-documentation-and-notebooks)
19+
- [License](#license)
1620

17-
- [I Have a Question](#i-have-a-question)
18-
- [I Want To Contribute](#i-want-to-contribute)
19-
- [Reporting Bugs](#reporting-bugs)
20-
- [Suggesting Enhancements](#suggesting-enhancements)
21-
- [Your First Code Contribution](#your-first-code-contribution)
22-
- [Improving The Documentation](#improving-the-documentation)
23-
- [Styleguides](#styleguides)
24-
- [Commit Messages](#commit-messages)
25-
- [Join The Project Team](#join-the-project-team)
21+
## Getting set up
2622

23+
PythonicDISORT targets **Python 3.8+**.
2724

25+
1) Fork the repo and clone your fork:
2826

29-
## I Have a Question
27+
```bash
28+
git clone https://github.com/<your-username>/Pythonic-DISORT.git
29+
cd Pythonic-DISORT
30+
```
3031

31-
> If you want to ask a question, we assume that you have read the available [Documentation](https://pythonic-disort.readthedocs.io/en/latest/).
32+
2) Create and activate a virtual environment:
3233

33-
Before you ask a question, it is best to search for existing [Issues](https://github.com/LDEO-CREW/Pythonic-DISORT/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first.
34+
```bash
35+
python -m venv .venv
36+
# macOS/Linux
37+
source .venv/bin/activate
38+
# Windows PowerShell
39+
# .venv\Scripts\Activate.ps1
40+
```
3441

35-
If you then still feel the need to ask a question and need clarification, we recommend the following:
42+
3) Install the project in editable mode.
3643

37-
- Open an [Issue](https://github.com/LDEO-CREW/Pythonic-DISORT/issues/new).
38-
- Provide as much context as you can about what you're running into.
39-
- Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant.
44+
- Minimal runtime deps (installs `numpy` + `scipy`)
45+
```bash
46+
pip install -e .
47+
```
4048

41-
We will then take care of the issue as soon as possible.
49+
- Dev/test deps (adds `pytest`)
50+
```bash
51+
pip install -e ".[pytest]"
52+
```
4253

43-
<!--
44-
You might want to create a separate issue tag for questions and include it in this description. People should then tag their issues accordingly.
54+
- Notebook/example deps (adds `autograd`, `jupyter`, `notebook`, `matplotlib`)
55+
```bash
56+
pip install -e ".[notebook_dependencies]"
57+
```
4558

46-
Depending on how large the project is, you may want to outsource the questioning, e.g. to Stack Overflow or Gitter. You may add additional contact and information possibilities:
47-
- IRC
48-
- Slack
49-
- Gitter
50-
- Stack Overflow tag
51-
- Blog
52-
- FAQ
53-
- Roadmap
54-
- E-Mail List
55-
- Forum
56-
-->
59+
## Running tests
5760

58-
## I Want To Contribute
61+
The repo contains verification tests under `pydisotest/`.
5962

60-
> ### Legal Notice <!-- omit in toc -->
61-
> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license.
63+
Run them like this:
6264

63-
### Reporting Bugs
65+
```bash
66+
pip install -e ".[pytest]"
67+
cd pydisotest
68+
pytest
69+
```
6470

65-
<!-- omit in toc -->
66-
#### Before Submitting a Bug Report
71+
Some of the deeper verification work (notably the later parts of the big documentation notebook) compares against a **wrapped Fortran DISORT** or equivalent. If you don’t have that locally, you can still run most tests and contribute meaningfully — just call it out in your PR.
6772

68-
A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.
73+
## Reporting bugs
6974

70-
- Make sure that you are using the latest version.
71-
- Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](https://pythonic-disort.readthedocs.io/en/latest/). If you are looking for support, you might want to check [this section](#i-have-a-question)).
72-
- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/LDEO-CREW/Pythonic-DISORTissues?q=label%3Abug).
73-
- Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue.
74-
- Collect information about the bug:
75-
- Stack trace (Traceback)
76-
- OS, Platform and Version (Windows, Linux, macOS, x86, ARM)
77-
- Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant.
78-
- Possibly your input and the output
79-
- Can you reliably reproduce the issue? And can you also reproduce it with older versions?
75+
Before opening a new issue:
76+
- Search existing issues (including closed ones).
77+
- Make sure you’re on a recent release.
78+
- Reduce the problem to a minimal reproducible example.
8079

81-
<!-- omit in toc -->
82-
#### How Do I Submit a Good Bug Report?
80+
When you open an issue, include:
81+
- What you expected vs what happened.
82+
- A minimal script or notebook cell that reproduces it.
83+
- Your environment: OS, Python version, numpy/scipy versions.
84+
- If relevant: number of layers, number of streams, phase function choice, boundary conditions, and any unusual parameter ranges.
8385

84-
> You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to <dh3065@columbia.edu>.
85-
<!-- You may add a PGP key to allow the messages to be sent encrypted as well. -->
86+
### Security
8687

87-
We use GitHub issues to track bugs and errors. If you run into an issue with the project:
88+
If the bug involves security, privacy, or accidental disclosure (e.g., credentials in logs), **email dh3065@columbia.edu** instead of filing an issue.
8889

89-
- Open an [Issue](https://github.com/LDEO-CREW/Pythonic-DISORT/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.)
90-
- Explain the behavior you would expect and the actual behavior.
91-
- Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case.
92-
- Provide the information you collected in the previous section.
90+
## Requesting changes
9391

94-
Once it's filed:
92+
Feature requests are welcome, but this project is primarily a **numerical/scientific** codebase — proposals should be specific.
9593

96-
- The project team will label the issue accordingly.
97-
- A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced.
98-
- If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#your-first-code-contribution).
94+
A good request includes:
95+
- The use case and why existing functionality isn’t enough.
96+
- A concrete API sketch (function signature, inputs/outputs).
97+
- Any relevant references (papers, equations, DISORT behavior you’re matching).
98+
- A suggestion for how to test/verify it.
9999

100-
<!-- You might want to create an issue template for bugs and errors that can be used as a guide and that defines the structure of the information to be included. If you do so, reference it here in the description. -->
100+
For larger changes, please open an issue first so effort doesn’t get wasted.
101101

102+
## Contributing code
102103

103-
### Suggesting Enhancements
104+
### Ground rules
105+
- Keep PRs small and focused.
106+
- Don’t add heavyweight new dependencies lightly. If a dependency is optional, keep it optional.
107+
- If you change numerical behavior, explain *why* and include a verification test.
104108

105-
This section guides you through submitting an enhancement suggestion for PythonicDISORT, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions.
109+
### Workflow
110+
1) Create a branch from `main`:
111+
```bash
112+
git checkout -b your-branch-name
113+
```
114+
2) Make your change with tests.
115+
3) Run:
116+
- `pytest` from `pydisotest/` (see above)
117+
4) Open a PR:
118+
- Describe what changed and why.
119+
- Link the related issue (if any).
120+
- Mention what you tested locally (and what you couldn’t).
106121

107-
<!-- omit in toc -->
108-
#### Before Submitting an Enhancement
122+
### Style
123+
There’s no strict formatter enforced in this repo. Aim for:
124+
- PEP 8-ish readability
125+
- Clear variable names (this is math-heavy code; clarity beats cleverness)
126+
- Docstrings for user-facing functions
109127

110-
- Make sure that you are using the latest version.
111-
- Read the [documentation](https://pythonic-disort.readthedocs.io/en/latest/) carefully and find out if the functionality is already covered, maybe by an individual configuration.
112-
- Perform a [search](https://github.com/LDEO-CREW/Pythonic-DISORT/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
113-
- Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library.
128+
## Improving documentation and notebooks
114129

115-
<!-- omit in toc -->
116-
#### How Do I Submit a Good Enhancement Suggestion?
130+
The docs are hosted on Read the Docs, and the repository includes a comprehensive Jupyter notebook (`docs/Pythonic-DISORT.ipynb`) that serves as extended documentation, derivations, and verification.
117131

118-
Enhancement suggestions are tracked as [GitHub issues](https://github.com/LDEO-CREW/Pythonic-DISORT/issues).
132+
If you edit notebooks or examples, please:
133+
- Keep outputs deterministic (avoid random seeds unless fixed).
134+
- Prefer smaller, faster-running cells when possible.
135+
- If you add a new example, explain the physical meaning of inputs/outputs.
119136

120-
- Use a **clear and descriptive title** for the issue to identify the suggestion.
121-
- Provide a **step-by-step description of the suggested enhancement** in as many details as possible.
122-
- **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you.
123-
- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. <!-- this should only be included if the project has a GUI -->
124-
- **Explain why this enhancement would be useful** to most PythonicDISORT users. You may also want to point out the other projects that solved it better and which could serve as inspiration.
137+
For local builds of the Sphinx docs (if you’re editing them), install whatever the docs build requires (often `sphinx`/`nbsphinx` plus the notebook extras), then build from the repo root. If you’re unsure, open a PR and we’ll help you get it building.
125138

126-
<!-- You might want to create an issue template for enhancement suggestions that can be used as a guide and that defines the structure of the information to be included. If you do so, reference it here in the description. -->
139+
## License
127140

128-
<!-- omit in toc -->
129-
## Attribution
130-
This guide is based on the **contributing-gen**. [Make your own](https://github.com/bttger/contributing-gen)!
141+
By contributing, you agree that your contributions will be licensed under the project’s MIT license.

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ These notebooks double up as examples of how to use PythonicDISORT. The tests wh
4949
* Test Problem 8: Absorbing / Isotropic-Scattering Medium (multiple layers)
5050
* Test Problem 9: General Emitting / Absorbing / Scattering Medium (multiple layers)
5151
* Test Problem 11: Single-Layer vs. Multiple Layers (no corresponding Jupyter Notebook)
52+
* Test Problem I: Antiderivative / integration functionality (no corresponding Jupyter Notebook)
5253

5354
# Installation
5455

@@ -60,15 +61,16 @@ These notebooks double up as examples of how to use PythonicDISORT. The tests wh
6061
* Python 3.8+
6162
* `numpy >= 1.8.0`
6263
* `scipy >= 1.8.0`
63-
* (OPTIONAL) `autograd >= 1.5`
64+
* (OPTIONAL) `autograd >= 1.5` (`autograd` can be used to compute gradients of the output functions)
6465
* (OPTIONAL) `pytest >= 6.2.5` (Required to use the command `pytest`, see *PyTest and examples of how to use PythonicDISORT*)
6566

6667
## (OPTIONAL) Additional requirements to run the Jupyter Notebook
6768
* `jupyter > 1.0.0`
6869
* `notebook > 6.5.2`
6970
* `matplotlib >= 3.6.0`
7071

71-
In addition, a F2PY-wrapped Stamnes' DISORT, or equivalent, is required to properly run the last section (section 6).
72+
In addition, a F2PY-wrapped Stamnes' DISORT or equivalent (https://github.com/kconnour/pyRT_DISORT may work)
73+
is required to properly run the last section (section 6).
7274

7375
## Compatibility
7476

0 commit comments

Comments
 (0)