Skip to content

Commit

Permalink
Rename to pomme
Browse files Browse the repository at this point in the history
  • Loading branch information
FredDeCeuster committed Feb 1, 2024
1 parent 873d000 commit ffa72b6
Show file tree
Hide file tree
Showing 98 changed files with 1,313 additions and 747 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install p3droslo from source
- name: Install pomme from source
run: |
pip install .
- name: Test with pytest
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/upload-to-anaconda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,28 +63,28 @@ jobs:
python-version: ${{ matrix.python-version }}


- name: Install dependencies and p3droslo (try 1)
- name: Install dependencies and pomme (try 1)
id: install_try1
run: |
sleep 5
mamba install pytest>=7
mamba install -c freddeceuster p3droslo
mamba install -c freddeceuster pomme
- name: Install dependencies and p3droslo (try 2)
- name: Install dependencies and pomme (try 2)
id: install_try2
if: steps.install_try1.outcome == 'failure'
run: |
sleep 5
mamba install pytest>=7
mamba install -c freddeceuster p3droslo
mamba install -c freddeceuster pomme
- name: Install dependencies and p3droslo (try 3)
- name: Install dependencies and pomme (try 3)
id: install_try3
if: steps.install_try2.outcome == 'failure'
run: |
sleep 5
mamba install pytest>=7
mamba install -c freddeceuster p3droslo
mamba install -c freddeceuster pomme

- name: Test with pytest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/upload-to-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install pytest>=7
- name: Install p3droslo from PyPI
- name: Install pomme from PyPI
run: |
pip install p3droslo
pip install pomme
- name: Test with pytest
run: |
pytest
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ build:
tools:
python: "3.9"

# Install p3droslo
# Install pomme
python:
install:
- requirements: docs/src/requirements.txt
Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Contributing to p3droslo
# Contributing to pomme

Thank you for considering contributing to p3droslo!
Thank you for considering contributing to pomme!
We highly appreciate any efforts to improve our software.
In case you have any suggestions, questions, possible bugs, or feature requests, please, open an issue [here](https://github.com/Magritte-code/p3droslo/issues).
In case you have any suggestions, questions, possible bugs, or feature requests, please, open an issue [here](https://github.com/Magritte-code/pomme/issues).


## Contributing examples and use cases

If you have used p3droslo in a way that is different from any of our [examples](https://p3droslo.readthedocs.io/en/latest/examples/index.html), we highly encourage you to contribute to the [examples](https://p3droslo.readthedocs.io/en/latest/examples/index.html) in the documentation.
If you have used pomme in a way that is different from any of our [examples](https://pomme.readthedocs.io/en/latest/examples/index.html), we highly encourage you to contribute to the [examples](https://pomme.readthedocs.io/en/latest/examples/index.html) in the documentation.
You can do this by preparing your example as a jupyter notebook and creating a pull request (see below). If you are unsure about your example or how to add it, please contact us and we can help.


## Contributing new functionality

We have a clear development strategy for p3droslo which is closely related to our reseach. Several features are being developed for several projects, all of which might not yet be publicly visible. Therefore, to prevent development overlap, we advise to contact us (e.g. by creating an [issue](https://github.com/Magritte-code/p3droslo/issues)), before starting to work on p3droslo yourself. We are happy to share our preliminary features if they could help you, or welcome you to our develoment team to colaboratively work on our projects.
We have a clear development strategy for pomme which is closely related to our reseach. Several features are being developed for several projects, all of which might not yet be publicly visible. Therefore, to prevent development overlap, we advise to contact us (e.g. by creating an [issue](https://github.com/Magritte-code/pomme/issues)), before starting to work on pomme yourself. We are happy to share our preliminary features if they could help you, or welcome you to our develoment team to colaboratively work on our projects.


## Contributing bug fixes
Expand All @@ -25,7 +25,7 @@ For bug fixes or smaller contributions, we gladly accept pull requests (see belo

The advised procedure for creating pull requests for Magritte goes as follows:

- Fork the p3droslo GitHub repository and create a new branch for your work;
- Fork the pomme GitHub repository and create a new branch for your work;
- Add your changes and commit them;
- Add or modify the existing tests for your changes;
- Verify if your new and all previous tests pass;
Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
# p3droslo
# pomme

_Probabilistic 3D Reconstruction of Spectral Line Observations._


![Build status](https://github.com/Magritte-code/p3droslo/actions/workflows/build-and-test.yaml/badge.svg)
![Build status](https://github.com/Magritte-code/p3droslo/actions/workflows/upload-to-pypi.yaml/badge.svg)
![Build status](https://github.com/Magritte-code/p3droslo/actions/workflows/upload-to-anaconda.yaml/badge.svg)
![Build status](https://github.com/Magritte-code/pomme/actions/workflows/build-and-test.yaml/badge.svg)
![Build status](https://github.com/Magritte-code/pomme/actions/workflows/upload-to-pypi.yaml/badge.svg)
![Build status](https://github.com/Magritte-code/pomme/actions/workflows/upload-to-anaconda.yaml/badge.svg)


## About

*p3droslo* is a python package that allows you to create **probabilistic 3D reconstructions** of astronomical **spectral line observations**.
*pomme* is a python package that allows you to create **probabilistic 3D reconstructions** of astronomical **spectral line observations**.

Observations of [spectral lines](https://en.wikipedia.org/wiki/Spectral_line) are indespensible in astronomy, since they encode a wealth of information about the physical and chemical conditions of the medium from which they originate.
For instance, their narrow extent in frequency space make them very sensitive to Doppler shifts, such that their shape encodes the motion of the medium along the line of sight.
As a result, given a good model for the line formation process and an inversion method, these physical and chemical properties can be retrieved from observations.
Currently, we mainly focus on retrieving the distributions of the abundance of the chemical species producing the line, the velocity field, and its kinetic temperature.
However, also other parameters can be retrieved.

More information about the model for [spectral line formation](https://p3droslo.readthedocs.io/en/latest/background/spectral_line_formation.html) and the [probabilistic reconstruction methods](https://p3droslo.readthedocs.io/en/latest/background/probabilistic_reconstruction.html) can be found in the [background](https://p3droslo.readthedocs.io/en/latest/background/index.html) pages.
More information about the model for [spectral line formation](https://pomme.readthedocs.io/en/latest/background/spectral_line_formation.html) and the [probabilistic reconstruction methods](https://pomme.readthedocs.io/en/latest/background/probabilistic_reconstruction.html) can be found in the [background](https://pomme.readthedocs.io/en/latest/background/index.html) pages.

*p3droslo* is built on top of [PyTorch](https://pytorch.org) and benefits a lot from functionality provided by [Astropy](https://www.astropy.org).
*pomme* is built on top of [PyTorch](https://pytorch.org) and benefits a lot from functionality provided by [Astropy](https://www.astropy.org).
It is currently developed and maintained by [Frederik De Ceuster](https://freddeceuster.github.io) at [KU Leuven](https://www.kuleuven.be/english/kuleuven/index.html).


## Installation

Get the latest release (version 0.0.15) either from [PyPI](https://pypi.org/project/p3droslo/), using `pip`, with:
Get the latest release (version 0.0.15) either from [PyPI](https://pypi.org/project/pomme/), using `pip`, with:
```
pip install p3droslo
pip install pomme
```
or from [Anaconda.org](https://anaconda.org/FredDeCeuster/p3droslo), using `conda`, with:
or from [Anaconda.org](https://anaconda.org/FredDeCeuster/pomme), using `conda`, with:
```
conda install -c freddeceuster p3droslo
conda install -c freddeceuster pomme
```
or download the [source code](https://github.com/Magritte-code/p3droslo/archive/refs/heads/main.zip), unzip, and install with `pip` by executing:
or download the [source code](https://github.com/Magritte-code/pomme/archive/refs/heads/main.zip), unzip, and install with `pip` by executing:
```
pip install .
```
Expand All @@ -43,17 +43,17 @@ in the root directory of the code.

## Documentation

Documentation with examples can be found at [p3droslo.readthedocs.io](https://p3droslo.readthedocs.io/en/latest/).
Documentation with examples can be found at [pomme.readthedocs.io](https://pomme.readthedocs.io/en/latest/).


## Issues

Please report any issues with this software or its documentation [here](https://github.com/Magritte-code/p3droslo/issues).
Please report any issues with this software or its documentation [here](https://github.com/Magritte-code/pomme/issues).


## Contributing

We are open to contributions to p3droslo. More information can be found [here](https://github.com/Magritte-code/p3droslo/blob/main/CONTRIBUTING.md).
We are open to contributions to pomme. More information can be found [here](https://github.com/Magritte-code/pomme/blob/main/CONTRIBUTING.md).


## Collaborating
Expand Down
4 changes: 2 additions & 2 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package:
name: p3droslo
name: pomme
version: "0.0.15"

about:
home: "https://github.com/Magritte-code/p3droslo"
home: "https://github.com/Magritte-code/pomme"
license: GPLv3
license_file: LICENSE
summary: Probabilistic 3D Reconstruction of Spectral Line Observations.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/API/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Python API
.. toctree::
:maxdepth: 3

p3droslo
pomme
4 changes: 2 additions & 2 deletions docs/src/API/p3droslo.forward.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
p3droslo.forward
pomme.forward
================

.. automodule:: p3droslo.forward
.. automodule:: pomme.forward
:members:
:undoc-members:
:show-inheritance:
4 changes: 2 additions & 2 deletions docs/src/API/p3droslo.haar.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
p3droslo.haar
pomme.haar
=============

.. automodule:: p3droslo.haar
.. automodule:: pomme.haar
:members:
:undoc-members:
:show-inheritance:
4 changes: 2 additions & 2 deletions docs/src/API/p3droslo.lines.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
p3droslo.lines
pomme.lines
==============

.. automodule:: p3droslo.lines
.. automodule:: pomme.lines
:members:
:undoc-members:
:show-inheritance:
4 changes: 2 additions & 2 deletions docs/src/API/p3droslo.loss.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
p3droslo.loss
pomme.loss
=============

.. automodule:: p3droslo.loss
.. automodule:: pomme.loss
:members:
:undoc-members:
:show-inheritance:
4 changes: 2 additions & 2 deletions docs/src/API/p3droslo.model.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
p3droslo.model
pomme.model
==============

.. automodule:: p3droslo.model
.. automodule:: pomme.model
:members:
:undoc-members:
:show-inheritance:
4 changes: 2 additions & 2 deletions docs/src/API/p3droslo.object.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
p3droslo.object
pomme.object
===============

.. automodule:: p3droslo.object
.. automodule:: pomme.object
:members:
:undoc-members:
:show-inheritance:
4 changes: 2 additions & 2 deletions docs/src/API/p3droslo.observation.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
p3droslo.observation
pomme.observation
====================

.. automodule:: p3droslo.observation
.. automodule:: pomme.observation
:members:
:undoc-members:
:show-inheritance:
4 changes: 2 additions & 2 deletions docs/src/API/p3droslo.plot.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
p3droslo.plot
pomme.plot
=============

.. automodule:: p3droslo.plot
.. automodule:: pomme.plot
:members:
:undoc-members:
:show-inheritance:
4 changes: 2 additions & 2 deletions docs/src/API/p3droslo.reconstruction.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
p3droslo.reconstruction
pomme.reconstruction
=======================

.. automodule:: p3droslo.reconstruction
.. automodule:: pomme.reconstruction
:members:
:undoc-members:
:show-inheritance:
24 changes: 12 additions & 12 deletions docs/src/API/p3droslo.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
p3droslo
pomme
========

.. automodule:: p3droslo
.. automodule:: pomme
:members:
:undoc-members:
:show-inheritance:
Expand All @@ -13,13 +13,13 @@ Submodules
.. toctree::
:maxdepth: 0

p3droslo.forward
p3droslo.haar
p3droslo.lines
p3droslo.loss
p3droslo.model
p3droslo.object
p3droslo.observation
p3droslo.plot
p3droslo.reconstruction
p3droslo.utils
pomme.forward
pomme.haar
pomme.lines
pomme.loss
pomme.model
pomme.object
pomme.observation
pomme.plot
pomme.reconstruction
pomme.utils
4 changes: 2 additions & 2 deletions docs/src/API/p3droslo.utils.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
p3droslo.utils module
pomme.utils module
=====================

.. automodule:: p3droslo.utils
.. automodule:: pomme.utils
:members:
:undoc-members:
:show-inheritance:
4 changes: 2 additions & 2 deletions docs/src/background/spectral_line_formation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The implementation on this line optical depth can be found in [src/p3droslo/lines.py](https://github.com/Magritte-code/p3droslo/blob/main/src/p3droslo/lines.py). It turned out that the implementation with two masks (one for case $\\left|b_{1}-b_{0}\\right| < 10^{-3}$ and one for its complement) is more expensive than doing both calculations for both cases, and only in the end mergingg the result. This, however, will mean that at seem point some $\\Delta \\tau$ will be NaN due to division by zero (coming from $b_{1}-b_{0}$), which causes no problem for the forward model (since these values will eventually be overwritten), but which causes gradients to diverge (see [this issue](https://github.com/Magritte-code/p3droslo/issues/2)). Therefore we add a small number $10^{-30}$ to the denominator."
"The implementation on this line optical depth can be found in [src/pomme/lines.py](https://github.com/Magritte-code/pomme/blob/main/src/pomme/lines.py). It turned out that the implementation with two masks (one for case $\\left|b_{1}-b_{0}\\right| < 10^{-3}$ and one for its complement) is more expensive than doing both calculations for both cases, and only in the end mergingg the result. This, however, will mean that at seem point some $\\Delta \\tau$ will be NaN due to division by zero (coming from $b_{1}-b_{0}$), which causes no problem for the forward model (since these values will eventually be overwritten), but which causes gradients to diverge (see [this issue](https://github.com/Magritte-code/pomme/issues/2)). Therefore we add a small number $10^{-30}$ to the denominator."
]
},
{
Expand Down Expand Up @@ -120,7 +120,7 @@
"metadata": {},
"source": [
"in which you can recognize the expansion of the exponential minus the first two terms.\n",
"The implementation of this intensity increment can be found in [src/p3droslo/forward.py](https://github.com/Magritte-code/p3droslo/blob/main/src/p3droslo/forward.py). For the same reaseon as with the line optical depth, we compute both cases for all values, to minimise the use of masks, and we add a small number ($10^{-30}$) to the denominator to avoid NaNs in gradients."
"The implementation of this intensity increment can be found in [src/pomme/forward.py](https://github.com/Magritte-code/pomme/blob/main/src/pomme/forward.py). For the same reaseon as with the line optical depth, we compute both cases for all values, to minimise the use of masks, and we add a small number ($10^{-30}$) to the denominator to avoid NaNs in gradients."
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions docs/src/benchmarks/Benchmark_0.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"import numpy as np\n",
"import torch\n",
"\n",
"from p3droslo.model import TensorModel\n",
"from p3droslo.lines import Line\n",
"from pomme.model import TensorModel\n",
"from pomme.lines import Line\n",
"from astropy import constants\n",
"from time import time\n",
"from ipywidgets import interact"
Expand Down
6 changes: 3 additions & 3 deletions docs/src/benchmarks/Benchmark_1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
"import numpy as np\n",
"import torch\n",
"\n",
"from p3droslo.model import TensorModel\n",
"from p3droslo.lines import Line\n",
"from p3droslo.utils import planck"
"from pomme.model import TensorModel\n",
"from pomme.lines import Line\n",
"from pomme.utils import planck"
]
},
{
Expand Down
Loading

0 comments on commit ffa72b6

Please sign in to comment.