Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ coverage:

ignore:
- tests/*
- vip_hci/vip_ds9.py
- src/vip_hci/vip_ds9.py
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ ignore =
I002,

exclude=
vip_hci/objects
src/vip_hci/objects
17 changes: 4 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,10 @@ jobs:
# pre-commit install-hooks
# pre-commit install
# # Run pre-commit hooks
# pre-commit run --files vip_hci/config/*.py
# pre-commit run --files vip_hci/fits/*.py
# pre-commit run --files vip_hci/fm/*.py
# pre-commit run --files vip_hci/greedy/*.py
# pre-commit run --files vip_hci/invprob/*.py
# pre-commit run --files vip_hci/metrics/*.py
# pre-commit run --files vip_hci/preproc/*.py
# pre-commit run --files vip_hci/psfsub/*.py
# pre-commit run --files vip_hci/stats/*.py
# pre-commit run --files vip_hci/var/*.py
# pre-commit run --files src/**/*.py
- name: Test with pytest
run: |
pytest tests/pre_3_10 --cov=vip_hci/ --cov-report=xml --splits 3 --group ${{ matrix.group }}
pytest tests/pre_3_10 --cov=src --cov-report=xml --splits 3 --group ${{ matrix.group }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3

Expand Down Expand Up @@ -87,9 +78,9 @@ jobs:
# pre-commit install-hooks
# pre-commit install
# # Run pre-commit hooks
# pre-commit run --files vip_hci/objects/*.py
# pre-commit run --files src/vip_hci/objects/*.py
- name: Test with pytest
run: |
pytest tests/post_3_10 --cov=vip_hci/objects/ --cov-report=xml
pytest tests/post_3_10 --cov=src/vpi_hci/objects/ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
21 changes: 5 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ docs:
rm -f docs/source/vip_hci.stats.rst
rm -f docs/source/vip_hci.var.rst
rm -f docs/source/vip_hci.vip_ds9.rst
sphinx-apidoc -o docs/source vip_hci
sphinx-apidoc -o docs/source src/vip_hci
cd docs/source/
$(MAKE) -C docs clean
$(MAKE) -C docs html

coverage:
coverage run --source=vip_hci -m pytest
coverage run --source=src -m pytest
coverage report -m

test:
Expand All @@ -48,18 +48,8 @@ test:
pre-commit install --hook-type post-rewrite
pre-commit install-hooks
pre-commit install
pre-commit run --files vip_hci/config/*.py
pre-commit run --files vip_hci/fits/*.py
pre-commit run --files vip_hci/fm/*.py
pre-commit run --files vip_hci/greedy/*.py
pre-commit run --files vip_hci/invprob/*.py
pre-commit run --files vip_hci/metrics/*.py
pre-commit run --files vip_hci/preproc/*.py
pre-commit run --files vip_hci/psfsub/*.py
pre-commit run --files vip_hci/stats/*.py
pre-commit run --files vip_hci/var/*.py
pre-commit run --files vip_hci/objects/*.py
pytest --cov=vip_hci/ --cov-report=xml
pre-commit run --files src/**/*.py
pytest --cov=src --cov-report=xml
rm confi_hist.pdf
rm confi_hist_gaussfit.pdf
rm confidence.txt
Expand All @@ -68,8 +58,7 @@ test:
rm -rf results/

pep8-format:
autopep8 --in-place --aggressive vip_hci/*.py
autopep8 --in-place --aggressive vip_hci/*/*.py
autopep8 --in-place --aggressive src/**/*.py
autopep8 --in-place --aggressive tests/*.py

clean:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
matplotlib.use("agg")


sys.path.insert(0, os.path.abspath('../../vip_hci/'))
sys.path.insert(0, os.path.abspath('../../src/vip_hci/'))

version = md_version('vip_hci')

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ dev = [

[tool.setuptools]
zip-safe = false
packages.find = { namespaces = false }
packages.find = { where = ["src"], namespaces = false }
18 changes: 18 additions & 0 deletions src/vip_hci/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from . import preproc
from . import config
from . import fits
from . import invprob
from . import psfsub
from . import fm
from . import metrics
from . import stats
from . import var
from . import objects
from .vip_ds9 import *


def __getattr__(name: str):
if name == '__version__':
from importlib.metadata import version
return version('vip_hci')
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
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 @@ -12,6 +12,7 @@
import numpy as np

import itertools as itt
from importlib.metadata import version
from inspect import signature, Parameter
from functools import wraps
import multiprocessing
Expand Down Expand Up @@ -43,8 +44,6 @@ def save(self, filename):


"""
from vip_hci import __version__ # TODO: replace this with importlib.metadata.version

vip_object = self.__class__.__name__

if hasattr(self, "_saved_attributes"):
Expand All @@ -60,7 +59,7 @@ def save(self, filename):
data["_item_{}".format(a)] = True

np.savez_compressed(
filename, _vip_version=__version__, _vip_object=vip_object, **data
filename, _vip_version=version('vip_hci'), _vip_object=vip_object, **data
)

else:
Expand All @@ -70,8 +69,6 @@ def save(self, filename):

@classmethod
def load(cls, filename):
from vip_hci import __version__ # TODO: replace this with importlib.metadata.version

try:
data = np.load(filename, allow_pickle=True)
except BaseException:
Expand All @@ -89,7 +86,7 @@ def load(cls, filename):
)

file_vip_version = data["_vip_version"].item()
if file_vip_version != __version__:
if file_vip_version != version('vip_hci'):
print(
"The file was saved with VIP {}. There may be some"
"compatibility issues. Use with care."
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.
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.
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.
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.
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.
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.
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.
File renamed without changes.
20 changes: 0 additions & 20 deletions vip_hci/__init__.py

This file was deleted.