drizzle 1.14.2__tar.gz → 1.15.0__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 drizzle might be problematic. Click here for more details.

Files changed (66) hide show
  1. drizzle-1.15.0/.github/workflows/build.yml +27 -0
  2. drizzle-1.15.0/.github/workflows/ci.yml +60 -0
  3. {drizzle-1.14.2 → drizzle-1.15.0}/CHANGES.rst +25 -2
  4. drizzle-1.15.0/MANIFEST.in +14 -0
  5. {drizzle-1.14.2 → drizzle-1.15.0}/PKG-INFO +47 -8
  6. {drizzle-1.14.2 → drizzle-1.15.0}/README.rst +12 -4
  7. drizzle-1.15.0/drizzle/__init__.py +11 -0
  8. {drizzle-1.14.2 → drizzle-1.15.0}/drizzle/dodrizzle.py +5 -2
  9. {drizzle-1.14.2 → drizzle-1.15.0}/drizzle/drizzle.py +5 -2
  10. {drizzle-1.14.2 → drizzle-1.15.0}/drizzle/tests/test_drizzle.py +6 -9
  11. {drizzle-1.14.2 → drizzle-1.15.0}/drizzle/tests/test_file_io.py +0 -1
  12. {drizzle-1.14.2 → drizzle-1.15.0}/drizzle/tests/test_overlap_calc.py +12 -4
  13. {drizzle-1.14.2 → drizzle-1.15.0}/drizzle/tests/test_pixmap.py +1 -2
  14. {drizzle-1.14.2 → drizzle-1.15.0}/drizzle.egg-info/PKG-INFO +47 -8
  15. {drizzle-1.14.2 → drizzle-1.15.0}/drizzle.egg-info/SOURCES.txt +2 -4
  16. {drizzle-1.14.2 → drizzle-1.15.0}/drizzle.egg-info/requires.txt +0 -2
  17. {drizzle-1.14.2 → drizzle-1.15.0}/pyproject.toml +4 -7
  18. {drizzle-1.14.2 → drizzle-1.15.0}/setup.py +3 -1
  19. {drizzle-1.14.2 → drizzle-1.15.0}/src/cdrizzleapi.c +17 -0
  20. {drizzle-1.14.2 → drizzle-1.15.0}/src/cdrizzlemap.c +2 -2
  21. {drizzle-1.14.2 → drizzle-1.15.0}/src/cdrizzleutil.h +12 -6
  22. drizzle-1.15.0/tox.ini +60 -0
  23. drizzle-1.14.2/.github/workflows/ci.yml +0 -38
  24. drizzle-1.14.2/.github/workflows/publish-to-pypi.yml +0 -16
  25. drizzle-1.14.2/MANIFEST.in +0 -18
  26. drizzle-1.14.2/drizzle/__init__.py +0 -11
  27. drizzle-1.14.2/licenses/README.rst +0 -5
  28. drizzle-1.14.2/tox.ini +0 -70
  29. {drizzle-1.14.2 → drizzle-1.15.0}/.coveragerc +0 -0
  30. {drizzle-1.14.2 → drizzle-1.15.0}/.flake8 +0 -0
  31. {drizzle-1.14.2 → drizzle-1.15.0}/.github/CODEOWNERS +0 -0
  32. {drizzle-1.14.2 → drizzle-1.15.0}/.gitignore +0 -0
  33. {drizzle-1.14.2 → drizzle-1.15.0}/.readthedocs.yaml +0 -0
  34. {drizzle-1.14.2 → drizzle-1.15.0}/CODE_OF_CONDUCT.md +0 -0
  35. {drizzle-1.14.2/licenses → drizzle-1.15.0}/LICENSE.rst +0 -0
  36. {drizzle-1.14.2 → drizzle-1.15.0}/docs/Makefile +0 -0
  37. {drizzle-1.14.2 → drizzle-1.15.0}/docs/_templates/autosummary/base.rst +0 -0
  38. {drizzle-1.14.2 → drizzle-1.15.0}/docs/_templates/autosummary/class.rst +0 -0
  39. {drizzle-1.14.2 → drizzle-1.15.0}/docs/_templates/autosummary/module.rst +0 -0
  40. {drizzle-1.14.2 → drizzle-1.15.0}/docs/conf.py +0 -0
  41. {drizzle-1.14.2 → drizzle-1.15.0}/docs/drizzle/api.rst +0 -0
  42. {drizzle-1.14.2 → drizzle-1.15.0}/docs/drizzle/index.rst +0 -0
  43. {drizzle-1.14.2 → drizzle-1.15.0}/docs/drizzle/user.rst +0 -0
  44. {drizzle-1.14.2 → drizzle-1.15.0}/docs/index.rst +0 -0
  45. {drizzle-1.14.2 → drizzle-1.15.0}/docs/make.bat +0 -0
  46. {drizzle-1.14.2 → drizzle-1.15.0}/docs/rtd_environment.yaml +0 -0
  47. {drizzle-1.14.2 → drizzle-1.15.0}/drizzle/calc_pixmap.py +0 -0
  48. {drizzle-1.14.2 → drizzle-1.15.0}/drizzle/doblot.py +0 -0
  49. {drizzle-1.14.2 → drizzle-1.15.0}/drizzle/tests/__init__.py +0 -0
  50. {drizzle-1.14.2 → drizzle-1.15.0}/drizzle/tests/test_cdrizzle.py +0 -0
  51. {drizzle-1.14.2 → drizzle-1.15.0}/drizzle/util.py +0 -0
  52. {drizzle-1.14.2 → drizzle-1.15.0}/drizzle.egg-info/dependency_links.txt +0 -0
  53. {drizzle-1.14.2 → drizzle-1.15.0}/drizzle.egg-info/not-zip-safe +0 -0
  54. {drizzle-1.14.2 → drizzle-1.15.0}/drizzle.egg-info/top_level.txt +0 -0
  55. {drizzle-1.14.2 → drizzle-1.15.0}/setup.cfg +0 -0
  56. {drizzle-1.14.2 → drizzle-1.15.0}/src/cdrizzleblot.c +0 -0
  57. {drizzle-1.14.2 → drizzle-1.15.0}/src/cdrizzleblot.h +0 -0
  58. {drizzle-1.14.2 → drizzle-1.15.0}/src/cdrizzlebox.c +0 -0
  59. {drizzle-1.14.2 → drizzle-1.15.0}/src/cdrizzlebox.h +0 -0
  60. {drizzle-1.14.2 → drizzle-1.15.0}/src/cdrizzlemap.h +0 -0
  61. {drizzle-1.14.2 → drizzle-1.15.0}/src/cdrizzleutil.c +0 -0
  62. {drizzle-1.14.2 → drizzle-1.15.0}/src/driz_portability.h +0 -0
  63. {drizzle-1.14.2 → drizzle-1.15.0}/src/tests/drizzletest.h +0 -0
  64. {drizzle-1.14.2 → drizzle-1.15.0}/src/tests/fct.h +0 -0
  65. {drizzle-1.14.2 → drizzle-1.15.0}/src/tests/pandokia_fct.h +0 -0
  66. {drizzle-1.14.2 → drizzle-1.15.0}/src/tests/utest_cdrizzle.c +0 -0
@@ -0,0 +1,27 @@
1
+ name: build
2
+
3
+ on:
4
+ release:
5
+ types: [ released ]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ build:
11
+ uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v1
12
+ with:
13
+ upload_to_pypi: ${{ (github.event_name == 'release') && (github.event.action == 'released') }}
14
+ targets: |
15
+ # Linux wheels
16
+ - cp3*-manylinux_x86_64
17
+ # MacOS wheels
18
+ - cp3*-macosx_x86_64
19
+ # Until we have arm64 runners, we can't automatically test arm64 wheels
20
+ - cp3*-macosx_arm64
21
+ # Windows wheels
22
+ - cp3*-win32
23
+ - cp3*-win_amd64
24
+ sdist: true
25
+ secrets:
26
+ pypi_token: ${{ secrets.PYPI_PASSWORD_STSCI_MAINTAINER }}
27
+
@@ -0,0 +1,60 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - '*.x'
8
+ tags:
9
+ - "*"
10
+ pull_request:
11
+ schedule:
12
+ - cron: '0 6 * * 1'
13
+
14
+ concurrency:
15
+ group: ${{ github.workflow }}-${{ github.ref }}
16
+ cancel-in-progress: true
17
+
18
+ jobs:
19
+ test:
20
+ uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
21
+ with:
22
+ envs: |
23
+ - linux: check-style
24
+ - linux: check-security
25
+
26
+ - linux: py39-xdist
27
+ - linux: py310-xdist
28
+ - linux: py311-xdist
29
+ - macos: py312-xdist
30
+ - windows: py312-xdist
31
+ - linux: py312-xdist-cov
32
+ coverage: codecov
33
+
34
+ #- linux: py312-xdist-devdeps
35
+
36
+ # When py312-xdist-devdeps works again, we can remove this.
37
+ # When, you ask? Well, maybe after numpy 2.0 is released, maybe.
38
+ dev_deps_tests:
39
+ name: py312-devdeps
40
+ runs-on: ubuntu-latest
41
+ steps:
42
+ - name: Checkout code
43
+ uses: actions/checkout@v4
44
+ with:
45
+ fetch-depth: 0
46
+ - name: Set up Python
47
+ uses: actions/setup-python@v4
48
+ with:
49
+ python-version: '3.12'
50
+ - name: Install and build
51
+ run: |
52
+ python -m pip install --upgrade pip setuptools wheel
53
+ python -m pip install --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy>=0.0.dev0 --pre --upgrade
54
+ python -m pip install --extra-index-url https://pypi.anaconda.org/liberfa/simple pyerfa>=0.0.dev0 --pre --upgrade
55
+ python -m pip install --extra-index-url https://pypi.anaconda.org/astropy/simple astropy>=0.0.dev0 --pre --upgrade
56
+ python -m pip install --no-build-isolation -v -e .[test]
57
+ - name: Test with dev deps
58
+ run: |
59
+ pip freeze
60
+ pytest -v
@@ -4,8 +4,31 @@
4
4
  Release Notes
5
5
  =============
6
6
 
7
- .. 1.14.2 (unreleased)
8
- ===================
7
+ 1.15.0 (2024-02-16)
8
+ ===================
9
+
10
+ - Dropped Python 3.8. [#128]
11
+
12
+ - Fixed a bug in the pixmap coordinate inversion routine. [#137]
13
+
14
+ - Deprecated "tophat" kernel which will be remover in the next release. It is
15
+ not working correctly and should not be used. [#140]
16
+
17
+ - Added warnings that "gaussian", "lanczos2", and "lanczos3" kernels are not
18
+ flux conserving. [#140]
19
+
20
+
21
+ 1.14.4 (2023-11-15)
22
+ ===================
23
+
24
+ - N/A
25
+
26
+
27
+ 1.14.3 (2023-10-02)
28
+ ===================
29
+
30
+ - Disable logging to fix a segfault on some systems. [#119]
31
+
9
32
 
10
33
  1.14.2 (2023-09-16)
11
34
  ===================
@@ -0,0 +1,14 @@
1
+ include README.rst
2
+ include CODE_OF_CONDUCT.md
3
+ include pyproject.toml
4
+ include LICENSE.rst
5
+
6
+ recursive-include src *.c *.h
7
+ recursive-include docs *
8
+
9
+ prune build
10
+ prune docs/_build
11
+ prune docs/api
12
+ prune drizzle/tests/data
13
+
14
+ global-exclude *.pyc *.o
@@ -1,20 +1,51 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: drizzle
3
- Version: 1.14.2
3
+ Version: 1.15.0
4
4
  Summary: A package for combining dithered images into a single image
5
5
  Author-email: STScI <help@stsci.edu>
6
+ License: Copyright (C) 2011,2014 Association of Universities for Research in
7
+ Astronomy (AURA)
8
+
9
+ Redistribution and use in source and binary forms, with or without
10
+ modification, are permitted provided that the following conditions
11
+ are met:
12
+
13
+ 1. Redistributions of source code must retain the above
14
+ copyright notice, this list of conditions and the following
15
+ disclaimer.
16
+
17
+ 2. Redistributions in binary form must reproduce the above
18
+ copyright notice, this list of conditions and the following
19
+ disclaimer in the documentation and/or other materials
20
+ provided with the distribution.
21
+
22
+ 3. The name of AURA and its representatives may not be used to
23
+ endorse or promote products derived from this software without
24
+ specific prior written permission.
25
+
26
+ THIS SOFTWARE IS PROVIDED BY AURA ``AS IS'' AND ANY EXPRESS OR
27
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29
+ ARE DISCLAIMED. IN NO EVENT SHALL AURA BE LIABLE FOR ANY DIRECT,
30
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
36
+ OF THE POSSIBILITY OF SUCH DAMAGE.
37
+
6
38
  Project-URL: Homepage, https://github.com/spacetelescope/drizzle
7
39
  Project-URL: Bug Tracker, https://github.com/spacetelescope/drizzle/issues
8
40
  Project-URL: Documentation, http://spacetelescope.github.io/drizzle/
9
41
  Project-URL: Source Code, https://github.com/spacetelescope/drizzle
10
- Requires-Python: >=3.8
42
+ Requires-Python: >=3.9
11
43
  Description-Content-Type: text/x-rst
44
+ License-File: LICENSE.rst
12
45
  Requires-Dist: numpy
13
46
  Requires-Dist: astropy
14
47
  Provides-Extra: test
15
48
  Requires-Dist: pytest; extra == "test"
16
- Requires-Dist: pytest-cov; extra == "test"
17
- Requires-Dist: coverage; extra == "test"
18
49
  Provides-Extra: docs
19
50
  Requires-Dist: tomli; python_version < "3.11" and extra == "docs"
20
51
  Requires-Dist: sphinx; extra == "docs"
@@ -29,7 +60,7 @@ drizzle Documentation
29
60
  :target: http://www.astropy.org
30
61
  :alt: Powered by Astropy Badge
31
62
 
32
- .. image:: https://codecov.io/github/spacetelescope/drizzle/branch/master/graphs/badge.svg
63
+ .. image:: https://codecov.io/github/spacetelescope/drizzle/branch/main/graphs/badge.svg
33
64
  :target: https://codecov.io/gh/spacetelescope/drizzle
34
65
  :alt: Drizzle's Coverage Status
35
66
 
@@ -37,6 +68,14 @@ drizzle Documentation
37
68
  :target: https://github.com/spacetelescope/drizzle/actions
38
69
  :alt: CI Status
39
70
 
71
+ .. image:: https://readthedocs.org/projects/spacetelescope-drizzle/badge/?version=latest
72
+ :target: https://spacetelescope-drizzle.readthedocs.io/en/latest/?badge=latest
73
+ :alt: Documentation Status
74
+
75
+ .. image:: https://img.shields.io/pypi/v/drizzle.svg
76
+ :target: https://pypi.org/project/drizzle
77
+ :alt: PyPI Status
78
+
40
79
  The ``drizzle`` library is a Python package for combining dithered images into a
41
80
  single image. This library is derived from code used in DrizzlePac. Like
42
81
  DrizzlePac, most of the code is implemented in the C language. The biggest
@@ -52,11 +91,11 @@ the new GWCS code.
52
91
  Requirements
53
92
  ------------
54
93
 
55
- - Python 3.6 or later
94
+ - Python 3.9 or later
56
95
 
57
- - Numpy 1.13 or later
96
+ - Numpy
58
97
 
59
- - Astropy 3.0 or later
98
+ - Astropy
60
99
 
61
100
  The Drizzle Algorithm
62
101
  ---------------------
@@ -5,7 +5,7 @@ drizzle Documentation
5
5
  :target: http://www.astropy.org
6
6
  :alt: Powered by Astropy Badge
7
7
 
8
- .. image:: https://codecov.io/github/spacetelescope/drizzle/branch/master/graphs/badge.svg
8
+ .. image:: https://codecov.io/github/spacetelescope/drizzle/branch/main/graphs/badge.svg
9
9
  :target: https://codecov.io/gh/spacetelescope/drizzle
10
10
  :alt: Drizzle's Coverage Status
11
11
 
@@ -13,6 +13,14 @@ drizzle Documentation
13
13
  :target: https://github.com/spacetelescope/drizzle/actions
14
14
  :alt: CI Status
15
15
 
16
+ .. image:: https://readthedocs.org/projects/spacetelescope-drizzle/badge/?version=latest
17
+ :target: https://spacetelescope-drizzle.readthedocs.io/en/latest/?badge=latest
18
+ :alt: Documentation Status
19
+
20
+ .. image:: https://img.shields.io/pypi/v/drizzle.svg
21
+ :target: https://pypi.org/project/drizzle
22
+ :alt: PyPI Status
23
+
16
24
  The ``drizzle`` library is a Python package for combining dithered images into a
17
25
  single image. This library is derived from code used in DrizzlePac. Like
18
26
  DrizzlePac, most of the code is implemented in the C language. The biggest
@@ -28,11 +36,11 @@ the new GWCS code.
28
36
  Requirements
29
37
  ------------
30
38
 
31
- - Python 3.6 or later
39
+ - Python 3.9 or later
32
40
 
33
- - Numpy 1.13 or later
41
+ - Numpy
34
42
 
35
- - Astropy 3.0 or later
43
+ - Astropy
36
44
 
37
45
  The Drizzle Algorithm
38
46
  ---------------------
@@ -0,0 +1,11 @@
1
+ """
2
+ A package for combining dithered images into a single image
3
+ """
4
+ from importlib.metadata import PackageNotFoundError, version
5
+
6
+
7
+ try:
8
+ __version__ = version(__name__)
9
+ except PackageNotFoundError:
10
+ # package is not installed
11
+ __version__ = 'unknown'
@@ -112,8 +112,11 @@ def dodrizzle(insci, input_wcs, inwht,
112
112
  kernel: str, optional
113
113
  The name of the kernel used to combine the input. The choice of
114
114
  kernel controls the distribution of flux over the kernel. The kernel
115
- names are: "square", "gaussian", "point", "tophat", "turbo", "lanczos2",
116
- and "lanczos3". The square kernel is the default.
115
+ names are: "square", "turbo", "point", "gaussian", "lanczos2",
116
+ and "lanczos3".
117
+
118
+ .. warning::
119
+ The "gaussian" and "lanczos2/3" kernels **DO NOT** conserve flux.
117
120
 
118
121
  fillval: str, optional
119
122
  The value a pixel is set to in the output if the input image does
@@ -60,8 +60,11 @@ class Drizzle(object):
60
60
  kernel : str, optional
61
61
  The name of the kernel used to combine the inputs. The choice of
62
62
  kernel controls the distribution of flux over the kernel. The kernel
63
- names are: "square", "gaussian", "point", "tophat", "turbo", "lanczos2",
64
- and "lanczos3". The square kernel is the default.
63
+ names are: "square", "turbo", "point", "gaussian", "lanczos2",
64
+ and "lanczos3".
65
+
66
+ .. warning::
67
+ The "gaussian" and "lanczos2/3" kernels **DO NOT** conserve flux.
65
68
 
66
69
  fillval : str, otional
67
70
  The value a pixel is set to in the output if the input image does
@@ -8,11 +8,8 @@ from astropy.io import fits
8
8
 
9
9
  from drizzle import drizzle, cdrizzle
10
10
 
11
-
12
11
  TEST_DIR = os.path.abspath(os.path.dirname(__file__))
13
12
  DATA_DIR = os.path.join(TEST_DIR, 'data')
14
-
15
-
16
13
  ok = False
17
14
 
18
15
 
@@ -37,12 +34,11 @@ def centroid(image, size, center):
37
34
  xlo = int(center[1] - size / 2)
38
35
  xhi = min(xlo + size, image.shape[1])
39
36
 
40
- center = [0.0, 0.0, 0.0]
41
- for y in range(ylo, yhi):
42
- for x in range(xlo, xhi):
43
- center[0] += y * image[y,x]
44
- center[1] += x * image[y,x]
45
- center[2] += image[y,x]
37
+ yx1 = np.mgrid[ylo:yhi, xlo:xhi, 1:2]
38
+ center = (yx1[..., 0] * image[ylo:yhi, xlo:xhi]).sum(
39
+ axis=(1, 2),
40
+ dtype=np.float64,
41
+ )
46
42
 
47
43
  if center[2] == 0.0:
48
44
  return None
@@ -304,6 +300,7 @@ def test_square_with_grid(tmpdir):
304
300
  insci = read_image(input_file)
305
301
  inwcs = read_wcs(input_file)
306
302
  insci = make_grid_image(insci, 64, 100.0)
303
+
307
304
  inwht = np.ones(insci.shape,dtype=insci.dtype)
308
305
  output_wcs = read_wcs(output_template)
309
306
 
@@ -8,7 +8,6 @@ from astropy.io import fits
8
8
  from drizzle import drizzle
9
9
  from drizzle import util
10
10
 
11
-
12
11
  TEST_DIR = os.path.abspath(os.path.dirname(__file__))
13
12
  DATA_DIR = os.path.join(TEST_DIR, 'data')
14
13
 
@@ -1,14 +1,11 @@
1
- import os
2
1
  import pytest
3
2
  from math import sqrt
3
+ from itertools import product
4
4
 
5
5
  import numpy as np
6
6
 
7
7
  from drizzle.cdrizzle import clip_polygon, invert_pixmap
8
8
 
9
-
10
- TEST_DIR = os.path.abspath(os.path.dirname(__file__))
11
- DATA_DIR = os.path.join(TEST_DIR, 'data')
12
9
  SQ2 = 1.0 / sqrt(2.0)
13
10
 
14
11
 
@@ -74,6 +71,17 @@ def test_invert_pixmap():
74
71
  assert np.allclose(xyin, [xr, yr], atol=0.05)
75
72
 
76
73
 
74
+ def test_invert_small_pixmap():
75
+ yin, xin = np.indices((2, 2), dtype=float)
76
+ pixmap = np.dstack([xin, yin])
77
+
78
+ test_coords = list(product(*(2 * [[-0.5, 1.5]])))
79
+
80
+ for xr, yr in test_coords:
81
+ xyin = invert_pixmap(pixmap, [xr, yr], [[-0.5, 1.5], [-0.5, 1.5]])
82
+ assert np.allclose(xyin, [xr, yr], atol=0.05)
83
+
84
+
77
85
  def test_poly_intersection_with_self():
78
86
  p = [(0, 0), (1, 0), (1, 1), (0, 1)]
79
87
 
@@ -1,4 +1,4 @@
1
- import os.path
1
+ import os
2
2
 
3
3
  import numpy as np
4
4
  from numpy.testing import assert_equal, assert_almost_equal
@@ -7,7 +7,6 @@ from astropy.io import fits
7
7
 
8
8
  from drizzle import calc_pixmap
9
9
 
10
-
11
10
  TEST_DIR = os.path.abspath(os.path.dirname(__file__))
12
11
  DATA_DIR = os.path.join(TEST_DIR, 'data')
13
12
 
@@ -1,20 +1,51 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: drizzle
3
- Version: 1.14.2
3
+ Version: 1.15.0
4
4
  Summary: A package for combining dithered images into a single image
5
5
  Author-email: STScI <help@stsci.edu>
6
+ License: Copyright (C) 2011,2014 Association of Universities for Research in
7
+ Astronomy (AURA)
8
+
9
+ Redistribution and use in source and binary forms, with or without
10
+ modification, are permitted provided that the following conditions
11
+ are met:
12
+
13
+ 1. Redistributions of source code must retain the above
14
+ copyright notice, this list of conditions and the following
15
+ disclaimer.
16
+
17
+ 2. Redistributions in binary form must reproduce the above
18
+ copyright notice, this list of conditions and the following
19
+ disclaimer in the documentation and/or other materials
20
+ provided with the distribution.
21
+
22
+ 3. The name of AURA and its representatives may not be used to
23
+ endorse or promote products derived from this software without
24
+ specific prior written permission.
25
+
26
+ THIS SOFTWARE IS PROVIDED BY AURA ``AS IS'' AND ANY EXPRESS OR
27
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29
+ ARE DISCLAIMED. IN NO EVENT SHALL AURA BE LIABLE FOR ANY DIRECT,
30
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
36
+ OF THE POSSIBILITY OF SUCH DAMAGE.
37
+
6
38
  Project-URL: Homepage, https://github.com/spacetelescope/drizzle
7
39
  Project-URL: Bug Tracker, https://github.com/spacetelescope/drizzle/issues
8
40
  Project-URL: Documentation, http://spacetelescope.github.io/drizzle/
9
41
  Project-URL: Source Code, https://github.com/spacetelescope/drizzle
10
- Requires-Python: >=3.8
42
+ Requires-Python: >=3.9
11
43
  Description-Content-Type: text/x-rst
44
+ License-File: LICENSE.rst
12
45
  Requires-Dist: numpy
13
46
  Requires-Dist: astropy
14
47
  Provides-Extra: test
15
48
  Requires-Dist: pytest; extra == "test"
16
- Requires-Dist: pytest-cov; extra == "test"
17
- Requires-Dist: coverage; extra == "test"
18
49
  Provides-Extra: docs
19
50
  Requires-Dist: tomli; python_version < "3.11" and extra == "docs"
20
51
  Requires-Dist: sphinx; extra == "docs"
@@ -29,7 +60,7 @@ drizzle Documentation
29
60
  :target: http://www.astropy.org
30
61
  :alt: Powered by Astropy Badge
31
62
 
32
- .. image:: https://codecov.io/github/spacetelescope/drizzle/branch/master/graphs/badge.svg
63
+ .. image:: https://codecov.io/github/spacetelescope/drizzle/branch/main/graphs/badge.svg
33
64
  :target: https://codecov.io/gh/spacetelescope/drizzle
34
65
  :alt: Drizzle's Coverage Status
35
66
 
@@ -37,6 +68,14 @@ drizzle Documentation
37
68
  :target: https://github.com/spacetelescope/drizzle/actions
38
69
  :alt: CI Status
39
70
 
71
+ .. image:: https://readthedocs.org/projects/spacetelescope-drizzle/badge/?version=latest
72
+ :target: https://spacetelescope-drizzle.readthedocs.io/en/latest/?badge=latest
73
+ :alt: Documentation Status
74
+
75
+ .. image:: https://img.shields.io/pypi/v/drizzle.svg
76
+ :target: https://pypi.org/project/drizzle
77
+ :alt: PyPI Status
78
+
40
79
  The ``drizzle`` library is a Python package for combining dithered images into a
41
80
  single image. This library is derived from code used in DrizzlePac. Like
42
81
  DrizzlePac, most of the code is implemented in the C language. The biggest
@@ -52,11 +91,11 @@ the new GWCS code.
52
91
  Requirements
53
92
  ------------
54
93
 
55
- - Python 3.6 or later
94
+ - Python 3.9 or later
56
95
 
57
- - Numpy 1.13 or later
96
+ - Numpy
58
97
 
59
- - Astropy 3.0 or later
98
+ - Astropy
60
99
 
61
100
  The Drizzle Algorithm
62
101
  ---------------------
@@ -4,15 +4,15 @@
4
4
  .readthedocs.yaml
5
5
  CHANGES.rst
6
6
  CODE_OF_CONDUCT.md
7
+ LICENSE.rst
7
8
  MANIFEST.in
8
9
  README.rst
9
- licenses
10
10
  pyproject.toml
11
11
  setup.py
12
12
  tox.ini
13
13
  .github/CODEOWNERS
14
+ .github/workflows/build.yml
14
15
  .github/workflows/ci.yml
15
- .github/workflows/publish-to-pypi.yml
16
16
  /home/runner/work/drizzle/drizzle/src/cdrizzleapi.c
17
17
  /home/runner/work/drizzle/drizzle/src/cdrizzleblot.c
18
18
  /home/runner/work/drizzle/drizzle/src/cdrizzlebox.c
@@ -48,8 +48,6 @@ drizzle/tests/test_drizzle.py
48
48
  drizzle/tests/test_file_io.py
49
49
  drizzle/tests/test_overlap_calc.py
50
50
  drizzle/tests/test_pixmap.py
51
- licenses/LICENSE.rst
52
- licenses/README.rst
53
51
  src/cdrizzleapi.c
54
52
  src/cdrizzleblot.c
55
53
  src/cdrizzleblot.h
@@ -12,5 +12,3 @@ tomli
12
12
 
13
13
  [test]
14
14
  pytest
15
- pytest-cov
16
- coverage
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "drizzle"
3
3
  description = "A package for combining dithered images into a single image"
4
- requires-python = ">=3.8"
4
+ requires-python = ">=3.9"
5
5
  authors = [
6
6
  { name = "STScI", email = "help@stsci.edu" },
7
7
  ]
@@ -18,7 +18,7 @@ file = "README.rst"
18
18
  content-type = "text/x-rst"
19
19
 
20
20
  [project.license]
21
- file = "licenses"
21
+ file = "LICENSE.rst"
22
22
  content-type = "text/plain"
23
23
 
24
24
  [project.urls]
@@ -30,8 +30,6 @@ Documentation = "http://spacetelescope.github.io/drizzle/"
30
30
  [project.optional-dependencies]
31
31
  test = [
32
32
  "pytest",
33
- "pytest-cov",
34
- "coverage",
35
33
  ]
36
34
  docs = [
37
35
  "tomli; python_version<'3.11'",
@@ -45,8 +43,7 @@ docs = [
45
43
  requires = [
46
44
  "setuptools>=61.2",
47
45
  "setuptools_scm[toml]>=3.4",
48
- "wheel",
49
- "numpy",
46
+ "numpy>=1.25",
50
47
  ]
51
48
  build-backend = "setuptools.build_meta"
52
49
 
@@ -58,7 +55,7 @@ include-package-data = false
58
55
  namespaces = false
59
56
 
60
57
  [tool.pytest.ini_options]
61
- minversion = "4.6"
58
+ minversion = "6"
62
59
  norecursedirs = [
63
60
  "build",
64
61
  "docs/_build",
@@ -35,4 +35,6 @@ def get_extensions():
35
35
  return [Extension(str('drizzle.cdrizzle'), sources, **cfg)]
36
36
 
37
37
 
38
- setup(ext_modules=get_extensions())
38
+ setup(
39
+ ext_modules=get_extensions(),
40
+ )
@@ -84,6 +84,7 @@ tdriz(PyObject *obj UNUSED_PARAM, PyObject *args, PyObject *keywords)
84
84
  struct driz_error_t error;
85
85
  struct driz_param_t p;
86
86
  integer_t isize[2], psize[2], wsize[2];
87
+ char warn_msg[96];
87
88
 
88
89
  driz_log_handle = driz_log_init(driz_log_handle);
89
90
  driz_log_message("starting tdriz");
@@ -182,6 +183,22 @@ tdriz(PyObject *obj UNUSED_PARAM, PyObject *args, PyObject *keywords)
182
183
  goto _exit;
183
184
  }
184
185
 
186
+ if (kernel == kernel_tophat) {
187
+ if (sprintf(warn_msg,
188
+ "Kernel '%s' has been deprecated and it will be removed in a future release.",
189
+ kernel_str) < 1) {
190
+ strcpy(warn_msg, "Selected kernel has been deprecated and it will be removed in a future release.");
191
+ }
192
+ PyErr_WarnEx(PyExc_DeprecationWarning, warn_msg, 1);
193
+ } else if (kernel == kernel_gaussian || kernel == kernel_lanczos2 || kernel == kernel_lanczos3) {
194
+ if (sprintf(warn_msg,
195
+ "Kernel '%s' is not a flux-conserving kernel.",
196
+ kernel_str) < 1) {
197
+ strcpy(warn_msg, "Selected kernel is not a flux-conserving kernel.");
198
+ }
199
+ PyErr_WarnEx(PyExc_DeprecationWarning, warn_msg, 1);
200
+ }
201
+
185
202
  if (pfract <= 0.001){
186
203
  printf("kernel reset to POINT due to pfract being set to 0.0...\n");
187
204
  kernel_str2enum("point", &kernel, &error);
@@ -280,8 +280,8 @@ invert_pixmap(struct driz_param_t *par, double xout, double yout, double *xin,
280
280
  xmax = ((double)par->xmax) + 0.5;
281
281
  ymin = ((double)par->ymin) - 0.5;
282
282
  ymax = ((double)par->ymax) + 0.5;
283
- dx = xmax;
284
- dy = ymax;
283
+ dx = xmax - xmin;
284
+ dy = ymax - ymin;
285
285
 
286
286
  niter = 0;
287
287
 
@@ -177,8 +177,6 @@ driz_param_dump(struct driz_param_t* p);
177
177
  /****************************************************************************/
178
178
  /* LOGGING */
179
179
 
180
- #define LOGGING
181
-
182
180
  #ifdef LOGGING
183
181
  extern FILE *driz_log_handle;
184
182
 
@@ -203,24 +201,32 @@ driz_log_init(FILE *handle) {
203
201
  }
204
202
  }
205
203
  if (!p) {
206
- sprintf(buf, "%ctmp%cdrizzle.log", dirsep, dirsep);
204
+ sprintf(buf, "drizzle.log");
207
205
  }
208
206
 
209
207
  handle = fopen(buf, "a");
210
- setbuf(handle, 0);
208
+ if (handle) {
209
+ setbuf(handle, 0);
210
+ }
211
211
  return handle;
212
212
  }
213
213
 
214
214
 
215
215
  static inline_macro int
216
216
  driz_log_close(FILE *handle) {
217
- return fclose(driz_log_handle);
217
+ if (handle) {
218
+ return fclose(handle);
219
+ }
218
220
  }
219
221
 
220
222
  static inline_macro int
221
223
  driz_log_message(const char* message) {
222
- if (! driz_log_handle)
224
+ if (!driz_log_handle) {
223
225
  driz_log_handle = driz_log_init(driz_log_handle);
226
+ if (!driz_log_handle) {
227
+ return 1;
228
+ }
229
+ }
224
230
 
225
231
  fputs(message, driz_log_handle);
226
232
  fputs("\n", driz_log_handle);
drizzle-1.15.0/tox.ini ADDED
@@ -0,0 +1,60 @@
1
+ [tox]
2
+ env_list =
3
+ check-{style,security}
4
+ py{39,310,311,312}{,-xdist}{,-devdeps,-cov}
5
+
6
+ # tox environments are constructed with so-called 'factors' (or terms)
7
+ # separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor:
8
+ # will only take effect if that factor is included in the environment name. To
9
+ # see a list of example environments that can be run, along with a description,
10
+ # run:
11
+ #
12
+ # tox -l -v
13
+ #
14
+
15
+ [testenv:check-style]
16
+ description = check code style
17
+ skip_install = true
18
+ changedir = {toxinidir}
19
+ deps =
20
+ ruff
21
+ commands =
22
+ ruff . {posargs}
23
+
24
+ [testenv:check-security]
25
+ description = run bandit to check security compliance
26
+ skip_install = true
27
+ changedir = {toxinidir}
28
+ deps =
29
+ bandit>=1.7
30
+ commands =
31
+ bandit drizzle -r -x drizzle/tests
32
+
33
+ [testenv]
34
+ description =
35
+ run tests
36
+ xdist: using parallel processing
37
+ devdeps: with development versions of dependencies
38
+ cov: with coverage
39
+
40
+ # Cannot do isolated build because of the test data.
41
+ package = editable
42
+
43
+ passenv = HOME,WINDIR,LC_ALL,LC_CTYPE,CC,CI
44
+
45
+ setenv =
46
+ devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/liberfa/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
47
+
48
+ deps =
49
+ xdist: pytest-xdist
50
+ cov: pytest-cov
51
+ devdeps: numpy>=0.0.dev0
52
+ devdeps: pyerfa>=0.0.dev0
53
+ devdeps: astropy>=0.0.dev0
54
+
55
+ commands =
56
+ pip freeze
57
+ pytest \
58
+ cov: --cov . --cov-config=.coveragerc --cov-report xml \
59
+ xdist: -n auto \
60
+ {posargs}
@@ -1,38 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches:
6
- - master
7
- - '*.x'
8
- tags:
9
- - "*"
10
- pull_request:
11
- schedule:
12
- - cron: '0 6 * * 1'
13
-
14
- concurrency:
15
- group: ${{ github.workflow }}-${{ github.ref }}
16
- cancel-in-progress: true
17
-
18
- jobs:
19
- check:
20
- uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
21
- with:
22
- envs: |
23
- - linux: check-style
24
- - linux: check-security
25
- - linux: build-dist
26
- test:
27
- uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
28
- with:
29
- envs: |
30
- - linux: py38-xdist
31
- - linux: py39-xdist
32
- - linux: py310-xdist
33
- - linux: py311-xdist
34
- - macos: py311-xdist
35
- - windows: py311-xdist
36
- - linux: py311-devdeps-xdist
37
- - linux: py311-xdist-cov
38
- coverage: codecov
@@ -1,16 +0,0 @@
1
- name: Publish to PyPI
2
-
3
- on:
4
- release:
5
- types: [released]
6
-
7
- jobs:
8
- publish:
9
- uses: spacetelescope/action-publish_to_pypi/.github/workflows/workflow.yml@master
10
- with:
11
- test: false
12
- build_platform_wheels: true # Set to true if your package contains a C extension
13
- secrets:
14
- user: ${{ secrets.PYPI_USERNAME_STSCI_MAINTAINER }}
15
- password: ${{ secrets.PYPI_PASSWORD_STSCI_MAINTAINER }} # WARNING: Do not hardcode secret values here! If you want to use a different user or password, you can override this secret by creating one with the same name in your Github repository settings.
16
- test_password: ${{ secrets.PYPI_PASSWORD_STSCI_MAINTAINER_TEST }}
@@ -1,18 +0,0 @@
1
- include README.rst
2
- include CODE_OF_CONDUCT.md
3
- include setup.cfg
4
-
5
- recursive-include *.c *
6
- recursive-include *.pxd *
7
- recursive-include *.pyx *
8
- recursive-include docs *
9
- recursive-include licenses *
10
- recursive-include cextern *
11
- recursive-include scripts *
12
-
13
- prune build
14
- prune docs/_build
15
- prune docs/api
16
- prune drizzle/tests/data
17
-
18
- global-exclude *.pyc *.o
@@ -1,11 +0,0 @@
1
- """
2
- A package for combining dithered images into a single image
3
- """
4
-
5
-
6
- from pkg_resources import get_distribution, DistributionNotFound
7
- try:
8
- __version__ = get_distribution(__name__).version
9
- except DistributionNotFound:
10
- # package is not installed
11
- __version__ = 'unknown'
@@ -1,5 +0,0 @@
1
- Licenses
2
- ========
3
-
4
- This directory holds license and credit information for the affiliated package,
5
- works the affiliated package is derived from, and/or datasets.
drizzle-1.14.2/tox.ini DELETED
@@ -1,70 +0,0 @@
1
- [tox]
2
- env_list =
3
- check-{style,security,build}
4
- test{,-warnings,-regtests}{,-cov}{,-xdist}
5
- build-{docs,dist}
6
-
7
- # tox environments are constructed with so-called 'factors' (or terms)
8
- # separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor:
9
- # will only take effect if that factor is included in the environment name. To
10
- # see a list of example environments that can be run, along with a description,
11
- # run:
12
- #
13
- # tox -l -v
14
- #
15
-
16
- [testenv:check-style]
17
- description = check code style, e.g. with flake8
18
- skip_install = true
19
- deps =
20
- ruff
21
- commands =
22
- ruff . {posargs}
23
-
24
- [testenv:check-security]
25
- description = run bandit to check security compliance
26
- skip_install = true
27
- deps =
28
- bandit>=1.7
29
- commands =
30
- bandit drizzle -r -x drizzle/tests
31
-
32
- [testenv]
33
- description =
34
- run tests
35
- warnings: treating warnings as errors
36
- regtests: with --bigdata and --slow flags
37
- cov: with coverage
38
- xdist: using parallel processing
39
- package = editable
40
- set_env =
41
- devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
42
- deps =
43
- pytest
44
- ci_watson
45
- xdist: pytest-xdist
46
- cov: pytest-cov
47
- commands_pre =
48
- devdeps: pip install numpy>=0.0.dev0 git+https://github.com/astropy/astropy -U --upgrade-strategy eager
49
- pip freeze
50
- commands =
51
- pytest \
52
- cov: --cov . --cov-report term-missing --cov-report xml \
53
- warnings: -W error \
54
- regtests: --bigdata --slow \
55
- xdist: -n auto \
56
- {posargs}
57
-
58
- [testenv:build-docs]
59
- description = invoke sphinx-build to build the HTML docs
60
- extras = docs
61
- commands =
62
- sphinx-build docs/ docs/_build
63
-
64
- [testenv:build-dist]
65
- description = build wheel and sdist
66
- skip_install = true
67
- deps =
68
- build
69
- commands =
70
- python -m build .
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