From 1e451931d15f87e9e23296925df70dcca43cd4b8 Mon Sep 17 00:00:00 2001 From: Volodymyr Savchenko Date: Tue, 26 Apr 2022 15:38:33 +0200 Subject: [PATCH 01/14] =?UTF-8?q?Bump=20version:=200.4.2=20=E2=86=92=200.4?= =?UTF-8?q?.3-dev0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION | 2 +- setup.cfg | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 2b7c5ae..4968f32 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.2 +0.4.3-dev0 diff --git a/setup.cfg b/setup.cfg index 75db7a6..69195bf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.4.2 +current_version = 0.4.3-dev0 commit = True tag = False parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? diff --git a/setup.py b/setup.py index e7c058c..a025ed0 100644 --- a/setup.py +++ b/setup.py @@ -9,6 +9,6 @@ setup(description="pymosaic-fits", long_description=open('README.md').read(), - version='0.4.2', + version='0.4.3-dev0', include_package_data=True, setup_requires=setup_requires) From 81624043982028326f567108e34a33cac0eebfa5 Mon Sep 17 00:00:00 2001 From: Volodymyr Savchenko Date: Tue, 26 Apr 2022 15:38:41 +0200 Subject: [PATCH 02/14] =?UTF-8?q?Bump=20version:=200.4.3-dev0=20=E2=86=92?= =?UTF-8?q?=200.4.4-dev0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION | 2 +- setup.cfg | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 4968f32..a091dd6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.3-dev0 +0.4.4-dev0 diff --git a/setup.cfg b/setup.cfg index 69195bf..88ae8ce 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.4.3-dev0 +current_version = 0.4.4-dev0 commit = True tag = False parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? diff --git a/setup.py b/setup.py index a025ed0..f2c774d 100644 --- a/setup.py +++ b/setup.py @@ -9,6 +9,6 @@ setup(description="pymosaic-fits", long_description=open('README.md').read(), - version='0.4.3-dev0', + version='0.4.4-dev0', include_package_data=True, setup_requires=setup_requires) From a283c57149ab5ba2400b78a0c5a916dfc42681f0 Mon Sep 17 00:00:00 2001 From: Volodymyr Savchenko Date: Tue, 26 Apr 2022 15:39:04 +0200 Subject: [PATCH 03/14] =?UTF-8?q?Bump=20version:=200.4.4-dev0=20=E2=86=92?= =?UTF-8?q?=200.4.5-dev0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION | 2 +- setup.cfg | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index a091dd6..a29c9c0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.4-dev0 +0.4.5-dev0 diff --git a/setup.cfg b/setup.cfg index 88ae8ce..8989b35 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.4.4-dev0 +current_version = 0.4.5-dev0 commit = True tag = False parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? diff --git a/setup.py b/setup.py index f2c774d..6d302cb 100644 --- a/setup.py +++ b/setup.py @@ -9,6 +9,6 @@ setup(description="pymosaic-fits", long_description=open('README.md').read(), - version='0.4.4-dev0', + version='0.4.5-dev0', include_package_data=True, setup_requires=setup_requires) From 229ddf8f17e8169c3b97e32c817949d86d1ccb44 Mon Sep 17 00:00:00 2001 From: Volodymyr Savchenko Date: Tue, 26 Apr 2022 16:11:34 +0200 Subject: [PATCH 04/14] =?UTF-8?q?Bump=20version:=200.4.5-dev0=20=E2=86=92?= =?UTF-8?q?=200.4.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION | 2 +- setup.cfg | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index a29c9c0..0bfccb0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.5-dev0 +0.4.5 diff --git a/setup.cfg b/setup.cfg index 8989b35..ba6b93e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.4.5-dev0 +current_version = 0.4.5 commit = True tag = False parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? diff --git a/setup.py b/setup.py index 6d302cb..b7cdeb7 100644 --- a/setup.py +++ b/setup.py @@ -9,6 +9,6 @@ setup(description="pymosaic-fits", long_description=open('README.md').read(), - version='0.4.5-dev0', + version='0.4.5', include_package_data=True, setup_requires=setup_requires) From 45293ec4b63db27b888af16f5cc506f0143534c6 Mon Sep 17 00:00:00 2001 From: Volodymyr Savchenko Date: Mon, 20 Jun 2022 16:26:22 +0200 Subject: [PATCH 05/14] forgotten pandas --- pyproject.toml | 3 +++ setup.cfg | 1 + tox.ini | 12 ++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 pyproject.toml create mode 100644 tox.ini diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2d6e225 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = 'setuptools.build_meta' diff --git a/setup.cfg b/setup.cfg index ba6b93e..6b3bda6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -55,6 +55,7 @@ install_requires = healpy click matplotlib + pandas tests_require = pytest mypy diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..e405c75 --- /dev/null +++ b/tox.ini @@ -0,0 +1,12 @@ +[tox] +envlist = + py39 +requires = + setuptools >= 30.3.0 + pip >= 19.3.1 + +isolated_build = true + +[testenv] +deps = pytest +commands = pytest {posargs} From afdec3a87bca941cc2ad5147af8a3cdb09528d4c Mon Sep 17 00:00:00 2001 From: Volodymyr Savchenko Date: Mon, 20 Jun 2022 16:52:07 +0200 Subject: [PATCH 06/14] test sextractr --- mosaic/treat.py | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/mosaic/treat.py b/mosaic/treat.py index 112ce10..9c36e89 100644 --- a/mosaic/treat.py +++ b/mosaic/treat.py @@ -329,28 +329,31 @@ def get_total_ebands(self): # print("found bands:", (len(gt) - 1) / 4) return int((len(gt) - 1) / 4) - def get_imatype(self, myhead): - extname='' - imatype='' - if 'EXTNAME' in myhead.keys(): - extname = myhead['EXTNAME'] - if 'IMATYPE' in myhead.keys(): - imatype = myhead['IMATYPE'] - - # Priority on IMATYPE ! + def get_imatype(self, myhead, default=None): + imatype = myhead.get('IMATYPE', '') + extname = myhead.get('EXTNAME', '') + + # Priority on IMATYPE ! if imatype != '': return imatype elif extname != '': return extname else: - raise KeyError('Both EXTNAME and IMATYPE are empty, impossible to get image type') - - def get_extension_by_type(self, exttype): - ff = fits.open(self.get_mosaic_fn()) - h_ret = None - for hh in ff: - if self.get_imatype(hh.header) == exttype: - h_ret = hh + if default is None: + raise KeyError('Both EXTNAME and IMATYPE are empty, impossible to get image type') + else: + return default + + def get_extension_by_type(self, exttype: str): + with fits.open(self.get_mosaic_fn()) as ff: + h_ret = None + for hh in ff: + if self.get_imatype(hh.header, '') == exttype: + if h_ret is not None: + raise NotImplementedError(f"found two extensions for requested type {exttype}") + + h_ret = hh.copy() + # Cannot close for way of dealing with input of this class #ff.close() if h_ret is not None: From 0cb4aae5f39554bdb2a9527cd2195fda48cc42a6 Mon Sep 17 00:00:00 2001 From: Volodymyr Savchenko Date: Mon, 20 Jun 2022 17:57:36 +0200 Subject: [PATCH 07/14] try to install tractor --- .github/workflows/python-package.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d5f2d09..65d3314 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -32,6 +32,13 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi pip install .[tests] + - name: Install sextractor + run: | + curl -L https://github.com/astromatic/sextractor/archive/refs/tags/2.25.0.tar.gz | tar xzf - + cd sextractor-2.25.0 + ./configure + make install + - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names From 86af5ba93132bc1f2c3e8eaed4b38e965dbaa935 Mon Sep 17 00:00:00 2001 From: Volodymyr Savchenko Date: Mon, 20 Jun 2022 18:05:07 +0200 Subject: [PATCH 08/14] autogen --- .github/workflows/python-package.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 65d3314..812cec3 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -36,6 +36,7 @@ jobs: run: | curl -L https://github.com/astromatic/sextractor/archive/refs/tags/2.25.0.tar.gz | tar xzf - cd sextractor-2.25.0 + bash autogen.sh ./configure make install From 24aabcc9a1016f0a4c970fc839e9bc95a4efbcad Mon Sep 17 00:00:00 2001 From: Volodymyr Savchenko Date: Mon, 20 Jun 2022 18:09:32 +0200 Subject: [PATCH 09/14] missing libraries --- .github/workflows/python-package.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 812cec3..584c1c0 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -34,6 +34,7 @@ jobs: - name: Install sextractor run: | + apt-get install -y fftw3 fftw3-dev pkg-config curl -L https://github.com/astromatic/sextractor/archive/refs/tags/2.25.0.tar.gz | tar xzf - cd sextractor-2.25.0 bash autogen.sh From f6733be89acbee4d0374b00543a93e348103a004 Mon Sep 17 00:00:00 2001 From: Volodymyr Savchenko Date: Mon, 20 Jun 2022 18:12:16 +0200 Subject: [PATCH 10/14] missing libraries --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 584c1c0..40435d5 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -34,7 +34,7 @@ jobs: - name: Install sextractor run: | - apt-get install -y fftw3 fftw3-dev pkg-config + sudo apt-get install -y fftw3 fftw3-dev pkg-config curl -L https://github.com/astromatic/sextractor/archive/refs/tags/2.25.0.tar.gz | tar xzf - cd sextractor-2.25.0 bash autogen.sh From 3897667ff85dc855cbbf6a8f0ba1f5b66b0146ce Mon Sep 17 00:00:00 2001 From: Volodymyr Savchenko Date: Mon, 20 Jun 2022 18:20:24 +0200 Subject: [PATCH 11/14] missing libraries --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 40435d5..d21096c 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -34,7 +34,7 @@ jobs: - name: Install sextractor run: | - sudo apt-get install -y fftw3 fftw3-dev pkg-config + sudo apt-get install -y fftw3 fftw3-dev pkg-config libblas-dev liblapack-dev curl -L https://github.com/astromatic/sextractor/archive/refs/tags/2.25.0.tar.gz | tar xzf - cd sextractor-2.25.0 bash autogen.sh From 255c9da46839c7fd269b413d93ba63b4848b148c Mon Sep 17 00:00:00 2001 From: Volodymyr Savchenko Date: Mon, 20 Jun 2022 18:23:19 +0200 Subject: [PATCH 12/14] missing libraries --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d21096c..e97d2ac 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -34,7 +34,7 @@ jobs: - name: Install sextractor run: | - sudo apt-get install -y fftw3 fftw3-dev pkg-config libblas-dev liblapack-dev + sudo apt-get install -y fftw3 fftw3-dev pkg-config libblas-dev liblapack-dev libatlas-cpp-0.6-dev curl -L https://github.com/astromatic/sextractor/archive/refs/tags/2.25.0.tar.gz | tar xzf - cd sextractor-2.25.0 bash autogen.sh From e72d37553507910771d82b27577d5a2c2e15026d Mon Sep 17 00:00:00 2001 From: Volodymyr Savchenko Date: Mon, 20 Jun 2022 18:26:41 +0200 Subject: [PATCH 13/14] missing libraries --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index e97d2ac..3e525fd 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -34,7 +34,7 @@ jobs: - name: Install sextractor run: | - sudo apt-get install -y fftw3 fftw3-dev pkg-config libblas-dev liblapack-dev libatlas-cpp-0.6-dev + sudo apt-get install -y fftw3 fftw3-dev pkg-config libblas-dev liblapack-dev libatlas-cpp-0.6-dev g++ make automake autoconf libtool libatlas-base-dev curl -L https://github.com/astromatic/sextractor/archive/refs/tags/2.25.0.tar.gz | tar xzf - cd sextractor-2.25.0 bash autogen.sh From a8a944e772bb792d0792f6855e6f1823edbf49e9 Mon Sep 17 00:00:00 2001 From: Volodymyr Savchenko Date: Mon, 20 Jun 2022 18:53:59 +0200 Subject: [PATCH 14/14] missing libraries --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 3e525fd..42c98d4 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -39,7 +39,7 @@ jobs: cd sextractor-2.25.0 bash autogen.sh ./configure - make install + sudo make install - name: Lint with flake8 run: |