roman-snpit-snappl 0.2.3__tar.gz → 0.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of roman-snpit-snappl might be problematic. Click here for more details.
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/.github/workflows/run_snappl_tests.yml +1 -1
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/MANIFEST.in +2 -1
- {roman_snpit_snappl-0.2.3/roman_snpit_snappl.egg-info → roman_snpit_snappl-0.2.4}/PKG-INFO +1 -1
- roman_snpit_snappl-0.2.4/changes/14.snappl.rst +1 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4/roman_snpit_snappl.egg-info}/PKG-INFO +1 -1
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/roman_snpit_snappl.egg-info/SOURCES.txt +2 -11
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/snappl/_version.py +2 -2
- roman_snpit_snappl-0.2.3/snappl/tests/__init__.py +0 -1
- roman_snpit_snappl-0.2.3/snappl/tests/conftest.py +0 -5
- roman_snpit_snappl-0.2.3/snappl/tests/docker-compose.yaml +0 -44
- roman_snpit_snappl-0.2.3/snappl/tests/image_test_data/Roman_TDS_simple_model_F184_662_11.fits.gz +0 -0
- roman_snpit_snappl-0.2.3/snappl/tests/image_test_data/test_cutout.npy +0 -0
- roman_snpit_snappl-0.2.3/snappl/tests/psf_test_data/testpsfarray.npz +0 -0
- roman_snpit_snappl-0.2.3/snappl/tests/test_opensim2024fitsimage.py +0 -56
- roman_snpit_snappl-0.2.3/snappl/tests/test_oversampled_image_psf.py +0 -24
- roman_snpit_snappl-0.2.3/snappl/tests/test_version_string.py +0 -3
- roman_snpit_snappl-0.2.3/snappl/tests/test_yaml_serialized_oversampled_image_psf.py +0 -49
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/.cruft.json +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/.github/CODEOWNERS +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/.github/ISSUE_TEMPLATE/PR_TEMPLATE.md +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/.github/dependabot.yml +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/.github/labeler.yml +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/.github/workflows/changelog.yml +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/.github/workflows/run_labeler.yml +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/.github/workflows/sphinx-deploy.yml +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/.github/workflows/sub_package_update.yml +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/.gitignore +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/.pre-commit-config.yaml +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/CHANGES.rst +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/CITATION.cff +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/CODE_OF_CONDUCT.md +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/CONTRIBUTING.md +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/LICENSE +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/README.rst +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/changes/.gitkeep +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/changes/10.snappl.rst +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/changes/13.bugfix.rst +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/changes/3.snappl.rst +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/changes/5.snappl.rst +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/changes/8.snappl.rst +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/changes/9.snappl.rst +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/codespell-ignore.txt +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/docs/Makefile +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/docs/_static/logo_black_filled.png +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/docs/changes.rst +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/docs/conf.py +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/docs/index.rst +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/docs/installation.rst +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/docs/make.bat +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/docs/usage.rst +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/licenses/.DS_Store +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/licenses/LICENSE.rst +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/licenses/README.rst +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/licenses/TEMPLATE_LICENSE.rst +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/pyproject.toml +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/roman_snpit_snappl.egg-info/dependency_links.txt +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/roman_snpit_snappl.egg-info/not-zip-safe +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/roman_snpit_snappl.egg-info/requires.txt +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/roman_snpit_snappl.egg-info/top_level.txt +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/setup.cfg +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/setup.py +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/snappl/__init__.py +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/snappl/_dev/__init__.py +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/snappl/_dev/scm_version.py +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/snappl/data/README.rst +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/snappl/image.py +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/snappl/psf.py +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/snappl/wcs.py +0 -0
- {roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/tox.ini +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Remove tests from what gets packaged for distribution
|
{roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/roman_snpit_snappl.egg-info/SOURCES.txt
RENAMED
|
@@ -26,6 +26,7 @@ tox.ini
|
|
|
26
26
|
changes/.gitkeep
|
|
27
27
|
changes/10.snappl.rst
|
|
28
28
|
changes/13.bugfix.rst
|
|
29
|
+
changes/14.snappl.rst
|
|
29
30
|
changes/3.snappl.rst
|
|
30
31
|
changes/5.snappl.rst
|
|
31
32
|
changes/8.snappl.rst
|
|
@@ -55,14 +56,4 @@ snappl/psf.py
|
|
|
55
56
|
snappl/wcs.py
|
|
56
57
|
snappl/_dev/__init__.py
|
|
57
58
|
snappl/_dev/scm_version.py
|
|
58
|
-
snappl/data/README.rst
|
|
59
|
-
snappl/tests/__init__.py
|
|
60
|
-
snappl/tests/conftest.py
|
|
61
|
-
snappl/tests/docker-compose.yaml
|
|
62
|
-
snappl/tests/test_opensim2024fitsimage.py
|
|
63
|
-
snappl/tests/test_oversampled_image_psf.py
|
|
64
|
-
snappl/tests/test_version_string.py
|
|
65
|
-
snappl/tests/test_yaml_serialized_oversampled_image_psf.py
|
|
66
|
-
snappl/tests/image_test_data/Roman_TDS_simple_model_F184_662_11.fits.gz
|
|
67
|
-
snappl/tests/image_test_data/test_cutout.npy
|
|
68
|
-
snappl/tests/psf_test_data/testpsfarray.npz
|
|
59
|
+
snappl/data/README.rst
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"""This module contains package tests."""
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# This is a compose file that creates an environment in which you can
|
|
2
|
-
# run tests. Either just do
|
|
3
|
-
#
|
|
4
|
-
# docker compose run runtests
|
|
5
|
-
#
|
|
6
|
-
# or, do
|
|
7
|
-
#
|
|
8
|
-
# docker compose up -d shell
|
|
9
|
-
#
|
|
10
|
-
# to get a shell session running the SNPIT cpu image. Connect to it
|
|
11
|
-
# with
|
|
12
|
-
#
|
|
13
|
-
# docker compose exec -it shell /bin/bash
|
|
14
|
-
#
|
|
15
|
-
# You can now do things in there, including
|
|
16
|
-
#
|
|
17
|
-
# cd /snappl/snappl/tests
|
|
18
|
-
# pytest -v
|
|
19
|
-
|
|
20
|
-
services:
|
|
21
|
-
shell:
|
|
22
|
-
image: rknop/roman-snpit-env:cpu-dev
|
|
23
|
-
entrypoint: [ "tail", "-f", "/etc/issue" ]
|
|
24
|
-
working_dir: /snappl
|
|
25
|
-
volumes:
|
|
26
|
-
- type: bind
|
|
27
|
-
source: ../..
|
|
28
|
-
target: /snappl
|
|
29
|
-
|
|
30
|
-
runtests:
|
|
31
|
-
image: rknop/roman-snpit-env:cpu-dev
|
|
32
|
-
working_dir: /snappl
|
|
33
|
-
entrypoint:
|
|
34
|
-
- /bin/sh
|
|
35
|
-
- -c
|
|
36
|
-
- |
|
|
37
|
-
pip install --no-deps -e . &&
|
|
38
|
-
cd snappl/tests &&
|
|
39
|
-
pytest -v
|
|
40
|
-
volumes:
|
|
41
|
-
- type: bind
|
|
42
|
-
source: ../..
|
|
43
|
-
target: /snappl
|
|
44
|
-
|
roman_snpit_snappl-0.2.3/snappl/tests/image_test_data/Roman_TDS_simple_model_F184_662_11.fits.gz
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# TODO -- remove these next few lines!
|
|
2
|
-
# This needs to be set up in an environment
|
|
3
|
-
# where snappl is available. This will happen "soon"
|
|
4
|
-
# Get Rob to fix all of this. For now, this is a hack
|
|
5
|
-
# so you can work short term.
|
|
6
|
-
import sys
|
|
7
|
-
import pathlib
|
|
8
|
-
sys.path.insert(0, str(pathlib.Path(__file__).parent/"extern/snappl"))
|
|
9
|
-
# End of lines that will go away once we do this right. (<-- From Rob.)
|
|
10
|
-
|
|
11
|
-
import numpy as np
|
|
12
|
-
from snappl.image import OpenUniverse2024FITSImage
|
|
13
|
-
import astropy
|
|
14
|
-
import pytest
|
|
15
|
-
from snpit_utils.logger import SNLogger
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def test_get_cutout():
|
|
19
|
-
imagepath = str(pathlib.Path(__file__).parent/'image_test_data/Roman_TDS_simple_model_F184_662_11.fits.gz')
|
|
20
|
-
image = OpenUniverse2024FITSImage(imagepath, None, 11)
|
|
21
|
-
ra, dec = 7.5942407686430995, -44.180904726970695
|
|
22
|
-
cutout = image.get_ra_dec_cutout(ra, dec, 5)
|
|
23
|
-
comparison_cutout = np.load(str(pathlib.Path(__file__).parent/'image_test_data/test_cutout.npy'),
|
|
24
|
-
allow_pickle=True)
|
|
25
|
-
message = "The cutout does not match the comparison cutout"
|
|
26
|
-
assert np.array_equal(cutout._data, comparison_cutout), message
|
|
27
|
-
# I am directly comparing for equality here because these numbers should
|
|
28
|
-
# never actually change, provided the underlying image is unaltered. -Cole
|
|
29
|
-
|
|
30
|
-
# Now we intentionally try to get a no overlap error.
|
|
31
|
-
with pytest.raises(astropy.nddata.utils.NoOverlapError) as excinfo:
|
|
32
|
-
ra, dec = 7.6942407686430995, -44.280904726970695
|
|
33
|
-
cutout = image.get_ra_dec_cutout(ra, dec, 5)
|
|
34
|
-
message = f"This should have caused a NoOverlapError but was actually {str(excinfo.value)}"
|
|
35
|
-
assert 'do not overlap' in str(excinfo.value), message
|
|
36
|
-
|
|
37
|
-
# Now we intentionally try to get a partial overlap error.
|
|
38
|
-
with pytest.raises(astropy.nddata.utils.PartialOverlapError) as excinfo:
|
|
39
|
-
ra, dec = 7.69380043,-44.13231831
|
|
40
|
-
cutout = image.get_ra_dec_cutout(ra, dec, 55)
|
|
41
|
-
message = f"This should have caused a PartialOverlapError but was actually {str(excinfo.value)}"
|
|
42
|
-
assert 'partial' in str(excinfo.value), message
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def test_set_data():
|
|
46
|
-
imagepath = str(pathlib.Path(__file__).parent/'image_test_data/Roman_TDS_simple_model_F184_662_11.fits.gz')
|
|
47
|
-
image = OpenUniverse2024FITSImage(imagepath, None, 11)
|
|
48
|
-
|
|
49
|
-
with pytest.raises(ValueError) as excinfo:
|
|
50
|
-
image.data = 'cheese'
|
|
51
|
-
SNLogger.debug(image.data)
|
|
52
|
-
message = f"This should have caused a ValueError but was actually {str(excinfo.value)}"
|
|
53
|
-
assert 'must be a' in str(excinfo.value), message
|
|
54
|
-
old_data = image.get_data()[0]
|
|
55
|
-
image._data = old_data + 1
|
|
56
|
-
assert np.array_equal(image._data, old_data + 1), "The data was not set correctly"
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
import numpy as np
|
|
4
|
-
from astropy.io import fits
|
|
5
|
-
|
|
6
|
-
from snappl.psf import OversampledImagePSF
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@pytest.fixture
|
|
10
|
-
def testpsf():
|
|
11
|
-
loaded = np.load('psf_test_data/testpsfarray.npz')
|
|
12
|
-
arr = loaded['args']
|
|
13
|
-
mypsf = OversampledImagePSF.create( arr, 3832., 255., oversample_factor=3. )
|
|
14
|
-
return mypsf
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def test_create( testpsf ):
|
|
18
|
-
assert testpsf._data.sum() == pytest.approx( 1., rel=1e-9 )
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
@pytest.mark.skip( reason="Comment out the skip to write some files for visual inspection" )
|
|
22
|
-
def test_interactive_write_stamp_to_fits_for_visual_inspection( testpsf ):
|
|
23
|
-
fits.writeto( 'test_deleteme_orig.fits', testpsf._data, overwrite=True )
|
|
24
|
-
fits.writeto( 'test_deleteme_resamp.fits', testpsf.get_stamp(), overwrite=True )
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import yaml
|
|
2
|
-
import random
|
|
3
|
-
import pathlib
|
|
4
|
-
import pytest
|
|
5
|
-
|
|
6
|
-
import numpy as np
|
|
7
|
-
|
|
8
|
-
from snappl.psf import YamlSerialized_OversampledImagePSF
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@pytest.fixture
|
|
12
|
-
def testpsf():
|
|
13
|
-
loaded = np.load('psf_test_data/testpsfarray.npz')
|
|
14
|
-
arr = loaded['args']
|
|
15
|
-
mypsf = YamlSerialized_OversampledImagePSF.create( arr, 3832., 255., oversample_factor=3. )
|
|
16
|
-
return mypsf
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def test_write( testpsf ):
|
|
20
|
-
barf = pathlib.Path( ''.join( random.choices( 'abcdefghijklmnopqrstuvwxyz', k=10 ) ) )
|
|
21
|
-
try:
|
|
22
|
-
testpsf.write( barf )
|
|
23
|
-
|
|
24
|
-
y = yaml.safe_load( open(barf) )
|
|
25
|
-
assert isinstance( y, dict )
|
|
26
|
-
assert y['x0'] == 3832.
|
|
27
|
-
assert y['y0'] == 255.
|
|
28
|
-
assert y['oversamp'] == 3.
|
|
29
|
-
assert y['shape0'] == 77
|
|
30
|
-
assert y['shape1'] == 77
|
|
31
|
-
assert isinstance( y['data'], str )
|
|
32
|
-
finally:
|
|
33
|
-
barf.unlink( missing_ok=True )
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def test_read( testpsf ):
|
|
37
|
-
barf = pathlib.Path( ''.join( random.choices( 'abcdefghijklmnopqrstuvwxyz', k=10 ) ) )
|
|
38
|
-
try:
|
|
39
|
-
testpsf.write( barf )
|
|
40
|
-
|
|
41
|
-
bpsf = YamlSerialized_OversampledImagePSF()
|
|
42
|
-
bpsf.read( barf )
|
|
43
|
-
assert bpsf._x0 == 3832.
|
|
44
|
-
assert bpsf._y0 == 255.
|
|
45
|
-
assert bpsf._oversamp == 3.
|
|
46
|
-
assert bpsf._data.shape == (77,77)
|
|
47
|
-
assert bpsf._data.sum() == pytest.approx( 1., rel=1e-9 )
|
|
48
|
-
finally:
|
|
49
|
-
barf.unlink( missing_ok=True )
|
|
File without changes
|
|
File without changes
|
{roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
RENAMED
|
File without changes
|
{roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/.github/workflows/sub_package_update.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/roman_snpit_snappl.egg-info/not-zip-safe
RENAMED
|
File without changes
|
{roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/roman_snpit_snappl.egg-info/requires.txt
RENAMED
|
File without changes
|
{roman_snpit_snappl-0.2.3 → roman_snpit_snappl-0.2.4}/roman_snpit_snappl.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|