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

refactor: Setup package structure to follow the Scientific Python Library Development Guide #103

Merged
merged 25 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .devcontainer/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies:
- pandas
- scipy
- h5py
- nox
lsetiawan marked this conversation as resolved.
Show resolved Hide resolved
- sphinx
- myst-parser
- jupyter-book
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ jobs:

echo "=== Testing wheel file ==="
# Install wheel to get dependencies and check import
python -m pip install --extra-index-url https://test.pypi.org/simple --upgrade --pre caustic
python -c "import caustic; print(caustics.__version__)"
python -m pip install --extra-index-url https://test.pypi.org/simple --upgrade --pre caustics
python -c "import caustics; print(caustics.__version__)"
echo "=== Done testing wheel file ==="

echo "=== Testing source tar file ==="
# Install tar gz and check import
python -m pip uninstall --yes caustic
python -m pip install --extra-index-url https://test.pypi.org/simple --upgrade --pre --no-binary=:all: caustic
python -c "import caustic; print(caustics.__version__)"
python -m pip uninstall --yes caustics
python -m pip install --extra-index-url https://test.pypi.org/simple --upgrade --pre --no-binary=:all: caustics
python -c "import caustics; print(caustics.__version__)"
echo "=== Done testing source tar file ==="

publish:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![tests](https://github.com/Ciela-Institute/caustics/actions/workflows/python-app.yml/badge.svg?branch=main)](https://github.com/Ciela-Institute/caustics/actions)
[![Docs](https://github.com/Ciela-Institute/caustics/actions/workflows/documentation.yaml/badge.svg)](https://github.com/Ciela-Institute/caustics/actions/workflows/documentation.yaml)
[![PyPI version](https://badge.fury.io/py/caustics.svg)](https://pypi.org/project/caustics/)
[![coverage](https://img.shields.io/codecov/c/github/Ciela-Institute/caustic)](https://app.codecov.io/gh/Ciela-Institute/caustic)
[![coverage](https://img.shields.io/codecov/c/github/Ciela-Institute/caustics)](https://app.codecov.io/gh/Ciela-Institute/caustics)

# caustics

Expand All @@ -26,14 +26,14 @@ pip install caustics

## Documentation

Please see our [documentation page](Ciela-Institute.github.io/caustics/) for
Please see our [documentation page](https://caustics.readthedocs.io/en/latest/) for
more detailed information.

## Contribution

We welcome contributions from collaborators and researchers interested in our
work. If you have improvements, suggestions, or new findings to share, please
submit a pull request. Your contributions help advance our research and analysis
submit an issue or pull request. Your contributions help advance our research and analysis
efforts.

To get started with your development (or fork), click the "Open with GitHub
Expand Down
8 changes: 4 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#

from caustics import __version__
# sys.path.insert(0, os.path.abspath('../src'))


Expand All @@ -23,9 +23,9 @@
author = "Ciela Institute"

# The short X.Y version
version = "0.5"
version = __version__
lsetiawan marked this conversation as resolved.
Show resolved Hide resolved
# The full version, including alpha/beta/rc tags
release = "v0.5.0"
release = version


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -158,7 +158,7 @@
"caustics Documentation",
author,
"caustics",
"One line description of project.",
"The gravitational lensing pipeline of the future.",
"Miscellaneous",
),
]
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def tests(session: nox.Session) -> None:
"""
Run the unit and regular tests. Use --cov to activate coverage.
"""
session.install(".[test]")
session.install(".[dev]")
session.run("pytest", *session.posargs)


Expand Down
2 changes: 1 addition & 1 deletion src/caustics/lenses/pixelated_convergence.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def _deflection_angle_conv2d(
# Use convergence_map as kernel since the kernel is twice as large. Flip since
# we actually want the cross-correlation.

2 * self.n_pix
pad = 2 * self.n_pix
convergence_map_flipped = convergence_map.flip((-1, -2))[
None, None
] # F.pad(, ((pad - self.n_pix)//2, (pad - self.n_pix)//2, (pad - self.n_pix)//2, (pad - self.n_pix)//2), mode = self.padding_mode)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_parametrized.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ def test_parametrized_name_setter_bad_names():
# Make sure bad names are catched by our added method. Bad names are name which cannot be used as class attributes.
good_names = ["variable", "_variable", "var_iable2"]
for name in good_names:
Sersic(name=name)
module = Sersic(name=name)
bad_names = ["for", "2variable", "variable!", "var-iable", "var iable", "def"]
for name in bad_names:
print(name)
with pytest.raises(NameError):
Sersic(name=name)
module = Sersic(name=name)


def test_parametrized_name_collision():
Expand Down
Loading