Skip to content

Commit

Permalink
v0.3.0: speed improvements and new helpers (#30)
Browse files Browse the repository at this point in the history
* New helper finder that can check and find_asteroids_in_mmr methods. 
* Moved astdys to a standalone package
* Add an ability to set multiple mmrs per body (speed up calculations)
* Better configs for save and plot (more options, more universation, see docs)
* Updated documentation. 
* Removed old code.
* Type of output image (pdf/png). 
* Save summary option.
* Tests + 100% coverage
* Update ci settings
  • Loading branch information
smirik authored Jul 25, 2024
1 parent f8ca9b5 commit 842f307
Show file tree
Hide file tree
Showing 50 changed files with 3,085 additions and 3,081 deletions.
83 changes: 42 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
name: Resonances App

on:
push:
branches: [main]
pull_request:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
strategy:
fail-fast: false
matrix:
python-version: [3.11.1]
poetry-version: [1.3.2]

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install poetry ${{ matrix.poetry-version }}
run: |
python -m ensurepip
python -m pip install --upgrade pip
python -m pip install poetry==${{ matrix.poetry-version }}
- name: View poetry --help
run: poetry --help

- name: Install dependencies
shell: bash
run: python -m poetry install --no-root

- name: Code Quality
run: poetry run black . --check

- name: Lint
run: poetry run flake8 --count

- name: Test with pytest
run: |
poetry run pytest -v tests/resonances
build:
strategy:
fail-fast: false
matrix:
python-version: [3.11.1]
poetry-version: [1.3.2]

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install poetry ${{ matrix.poetry-version }}
run: |
python -m ensurepip
python -m pip install --upgrade pip
python -m pip install poetry==${{ matrix.poetry-version }}
- name: View poetry --help
run: poetry --help

- name: Install dependencies
shell: bash
run: python -m poetry install

- name: Code Quality
run: poetry run black . --check

- name: Lint
run: poetry run flake8 --count

- name: Test with pytest
run: |
poetry run pytest -v tests/resonances
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ publish-test:
publish:
poetry publish --build

coverage:
poetry run coverage run -m pytest -v tests/resonances
poetry run coverage report -m

clean:
rm -f cache/allnum.cat
rm -f cache/solar.bin
Expand Down
65 changes: 48 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,46 @@ For more information, [read the documentation](https://smirik.github.io/resonanc

**Note:** while this app has many functional and integration tests built in, it is still in the dev stage. Hence, it might include some inconsistencies. So, any community help is appreciated!

## What's new

### July 2024

1. Now you can choose the type of the output image: it could be either ` pdf`` or `png`.

```python
sim = resonances.Simulation()
...
sim.image_type = 'pdf'
```

2. You can plot only resonant asteroids:

```python
sim = resonances.Simulation()
...
sim.plot_only_identified = True
```

If it is `true`, then the app will plot every resonant asteroid even if `plot` is `False`. If `plot` is `True`, this option is ignored.

3. New finder module (easy resonance identification):

```python
import resonances

sim = resonances.finder.find([463, 490], planets=['Mars', 'Jupiter', 'Saturn'])
sim.run()
```

## Features

The package:

- can automatically identify two-body and three-body mean-motion resonance in the Solar system,
- accurately differentiates different types of resonances (pure, transient, uncertain),
- provides an interface for mass tasks (i.e. find resonant areas in a planetary system),
- can plot time series and periodograms,
- and, yeah, it is well tested ;)
- can automatically identify two-body and three-body mean-motion resonance in the Solar system,
- accurately differentiates different types of resonances (pure, transient, uncertain),
- provides an interface for mass tasks (i.e. find resonant areas in a planetary system),
- can plot time series and periodograms,
- and, yeah, it is well tested ;)

It actively uses [REBOUND integrator](https://rebound.readthedocs.io) maintained by Hanno Rein and others.

Expand Down Expand Up @@ -57,9 +88,9 @@ For those who are not familiar with the mean-motion resonances, here is the list

Whenever you use this package, we are kindly asking you to refer to one of the following papers (please choose the appropriate):

1. **The package itself**:
1. **The package itself**:

* Smirnov, E. A. (2023). A new python package for identifying celestial bodies trapped in mean-motion resonances. Astronomy and Computing. https://doi.org/10.1016/j.ascom.2023.100707
- Smirnov, E. A. (2023). A new python package for identifying celestial bodies trapped in mean-motion resonances. Astronomy and Computing. https://doi.org/10.1016/j.ascom.2023.100707

```tex
@article{Smirnov2023,
Expand All @@ -75,27 +106,27 @@ Whenever you use this package, we are kindly asking you to refer to one of the f
}
```

2. **The Libration module and automatic identification of librations**:
2. **The Libration module and automatic identification of librations**:

* Smirnov, E. A. (2023). A new python package for identifying celestial bodies trapped in mean-motion resonances. Astronomy and Computing, 100707. https://doi.org/10.1016/j.ascom.2023.100707
- Smirnov, E. A. (2023). A new python package for identifying celestial bodies trapped in mean-motion resonances. Astronomy and Computing, 100707. https://doi.org/10.1016/j.ascom.2023.100707

3. **Mass identification of mean-motion resonances:**
3. **Mass identification of mean-motion resonances:**

* Smirnov, E. A., & Dovgalev, I. S. (2018). Identification of Asteroids in Two-Body Resonances. Solar System Research, 52(4), 347–354. https://doi.org/10.1134/S0038094618040056
* Smirnov, E. A., Dovgalev, I. S. & Popova, E. A. Asteroids in three-body mean motion resonances with planets. Icarus (2017) doi:10.1016/j.icarus.2017.09.032.
- Smirnov, E. A., & Dovgalev, I. S. (2018). Identification of Asteroids in Two-Body Resonances. Solar System Research, 52(4), 347–354. https://doi.org/10.1134/S0038094618040056
- Smirnov, E. A., Dovgalev, I. S. & Popova, E. A. Asteroids in three-body mean motion resonances with planets. Icarus (2017) doi:10.1016/j.icarus.2017.09.032.

## Authors

The authors of the package:

- [Evgeny Smirnov](https://github.com/smirik) ([FB](https://facebook.com/smirik), [Telegram](https://t.me/smirik))
- [Evgeny Smirnov](https://github.com/smirik) ([FB](https://facebook.com/smirik), [Telegram](https://t.me/smirik))

## Acknowledgement

- Many thanks to the co-authors of the papers (prof. I. I. Shevchenko, I. Dovgalev, and Dr. E. Popova).
- The creators of [REBOUND integrator](https://rebound.readthedocs.io).
- The creators of [Astropy](http://astropy.org).
- The creators of `numpy`, `scipy`, `pandas`, and `matplotlib`.
- Many thanks to the co-authors of the papers (prof. I. I. Shevchenko, I. Dovgalev, and Dr. E. Popova).
- The creators of [REBOUND integrator](https://rebound.readthedocs.io).
- The creators of [Astropy](http://astropy.org).
- The creators of `numpy`, `scipy`, `pandas`, and `matplotlib`.

## Contributing

Expand Down
17 changes: 8 additions & 9 deletions docs/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@ This package is available under MIT License. The text of the license is availabl

The authors of the package:

- [Evgeny Smirnov](https://github.com/smirik) ([FB](https://facebook.com/smirik), [Telegram](https://t.me/smirik))
- [Evgeny Smirnov](https://github.com/smirik) ([FB](https://facebook.com/smirik), [Telegram](https://t.me/smirik))

## References

Whenever you use this package, we are kindly asking you to refer to one of the following papers (please choose the appropriate):

1. **The package itself**:
1. **The package itself**:
- Smirnov, E. A. (2023). A new python package for identifying celestial bodies trapped in mean-motion resonances. Astronomy and Computing. https://doi.org/10.1016/j.ascom.2023.100707
2. **The Libration module and automatic identification of librations**:

* Smirnov, E. A. (2023). A new python package for identifying celestial bodies trapped in mean-motion resonances. Astronomy and Computing. https://doi.org/10.1016/j.ascom.2023.100707
2. **The Libration module and automatic identification of librations**:
- Smirnov, E. A. (2023). A new python package for identifying celestial bodies trapped in mean-motion resonances. Astronomy and Computing, 100707. https://doi.org/10.1016/j.ascom.2023.100707

* Smirnov, E. A. (2023). A new python package for identifying celestial bodies trapped in mean-motion resonances. Astronomy and Computing, 100707. https://doi.org/10.1016/j.ascom.2023.100707
3. **Mass identification of mean-motion resonances:**

3. **Mass identification of mean-motion resonances:**

* Smirnov, E. A., & Dovgalev, I. S. (2018). Identification of Asteroids in Two-Body Resonances. Solar System Research, 52(4), 347–354. https://doi.org/10.1134/S0038094618040056
* Smirnov, E. A., Dovgalev, I. S. & Popova, E. A. Asteroids in three-body mean motion resonances with planets. Icarus (2017) doi:10.1016/j.icarus.2017.09.032.
- Smirnov, E. A., & Dovgalev, I. S. (2018). Identification of Asteroids in Two-Body Resonances. Solar System Research, 52(4), 347–354. https://doi.org/10.1134/S0038094618040056
- Smirnov, E. A., Dovgalev, I. S. & Popova, E. A. Asteroids in three-body mean motion resonances with planets. Icarus (2017) doi:10.1016/j.icarus.2017.09.032.
Loading

0 comments on commit 842f307

Please sign in to comment.