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

Update packaging and add tox #341

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ docs/_build/*
goodman_pipeline/data/dcr-source/dcr
goodman_pipeline/data/dcr-source/*.o
/dev-tools/
.tox/*
.tmp/*
.eggs/*
.cache/*
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Goodman High Throughput Spectrograph Data Reduction Pipeline

[![Build Status](https://travis-ci.org/soar-telescope/goodman_pipeline.svg?branch=master)](https://travis-ci.org/soar-telescope/goodman_pipeline)
![Goodman Pipeline](https://github.com/soar-telescope/goodman_pipeline/workflows/Goodman%20Pipeline/badge.svg?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/soar-telescope/goodman_pipeline/badge.svg?branch=master)](https://coveralls.io/github/soar-telescope/goodman_pipeline?branch=master)
[![Documentation Status](https://readthedocs.org/projects/goodman/badge/?version=latest)](http://goodman.readthedocs.io/en/latest/?badge=latest)
[![pypi](https://img.shields.io/pypi/v/goodman_pipeline.svg?style=flat)](https://pypi.org/project/goodman-pipeline/)
[![astropy](http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat)](http://www.astropy.org/)

![Goodman Pipeline](https://github.com/soar-telescope/goodman_pipeline/workflows/Goodman%20Pipeline/badge.svg?branch=master)
![Goodman Pipeline with Conda](https://github.com/soar-telescope/goodman_pipeline/workflows/Goodman%20Pipeline%20with%20Conda/badge.svg)

![Upload to PYPI](https://github.com/soar-telescope/goodman_pipeline/workflows/Upload%20to%20PYPI/badge.svg)

## Overview
Expand Down Expand Up @@ -51,8 +50,8 @@ open a [new Issue](https://github.com/soar-telescope/goodman_pipeline/issues/new

We acknowledge the important contribution of [David Sanmartim](https://github.com/dsanmartim), who developed
the initial incarnation of the redccd module. We thank [Tina Armond](https://github.com/tarmond) for her
invaluable help in adding calibrated comparison lamps to the library of
reference comparison lamps for wavelngth solution.
invaluable help in adding calibrated comparison lamps to the [library](https://goodman.readthedocs.io/projects/lamps/en/latest/) of
reference comparison lamps for wavelength solution.

Our work would not be possible without the friendly work atmosphere at CTIO
headquarters in La Serena, were we can interact with our SOAR and CTIO
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
Welcome to the Goodman HTS Pipeline Documentation
=================================================

.. image:: https://travis-ci.org/soar-telescope/goodman_pipeline.svg?branch=master
:target: https://travis-ci.org/soar-telescope/goodman_pipeline
.. image:: https://github.com/soar-telescope/goodman_pipeline/workflows/Goodman%20Pipeline/badge.svg?branch=master
:alt: Goodman Pipeline
.. image:: https://coveralls.io/repos/github/soar-telescope/goodman_pipeline/badge.svg?branch=master
:target: https://coveralls.io/github/soar-telescope/goodman_pipeline?branch=master
.. image:: https://readthedocs.org/projects/goodman/badge/?version=latest
Expand Down
1 change: 0 additions & 1 deletion goodman_pipeline/core/tests/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion goodman_pipeline/images/tests/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion goodman_pipeline/spectroscopy/tests/__init__.py

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -21,62 +21,62 @@
logging.disable(logging.CRITICAL)

# import all classes in core.py
from ..core import (GenerateDcrParFile,
NightDataContainer,
NoMatchFound,
NotEnoughLinesDetected,
NoTargetException,
ReferenceData,
SaturationValues,
SpectroscopicMode)
from goodman_pipeline.core.core import (GenerateDcrParFile,
NightDataContainer,
NoMatchFound,
NotEnoughLinesDetected,
NoTargetException,
ReferenceData,
SaturationValues,
SpectroscopicMode)


# import of functions in core.py
from ..core import (astroscrappy_lacosmic,
add_linear_wavelength_solution,
add_wcs_keys,
bias_subtract,
bin_reference_data,
call_cosmic_rejection,
classify_spectroscopic_data,
combine_data,
convert_time,
create_master_bias,
create_master_flats,
cross_correlation,
dcr_cosmicray_rejection,
define_trim_section,
extraction,
extract_fractional_pixel,
extract_optimal,
evaluate_wavelength_solution,
fix_keywords,
fractional_sum,
get_best_flat,
get_central_wavelength,
get_lines_in_lamp,
get_overscan_region,
get_spectral_characteristics,
get_slit_trim_section,
get_twilight_time,
identify_targets,
image_overscan,
image_trim,
interpolate,
is_file_saturated,
linearize_spectrum,
name_master_flats,
normalize_master_flat,
ra_dec_to_deg,
read_fits,
record_trace_information,
save_extracted,
search_comp_group,
setup_logging,
trace,
trace_targets,
validate_ccd_region,
write_fits)
from goodman_pipeline.core.core import (astroscrappy_lacosmic,
add_linear_wavelength_solution,
add_wcs_keys,
bias_subtract,
bin_reference_data,
call_cosmic_rejection,
classify_spectroscopic_data,
combine_data,
convert_time,
create_master_bias,
create_master_flats,
cross_correlation,
dcr_cosmicray_rejection,
define_trim_section,
extraction,
extract_fractional_pixel,
extract_optimal,
evaluate_wavelength_solution,
fix_keywords,
fractional_sum,
get_best_flat,
get_central_wavelength,
get_lines_in_lamp,
get_overscan_region,
get_spectral_characteristics,
get_slit_trim_section,
get_twilight_time,
identify_targets,
image_overscan,
image_trim,
interpolate,
is_file_saturated,
linearize_spectrum,
name_master_flats,
normalize_master_flat,
ra_dec_to_deg,
read_fits,
record_trace_information,
save_extracted,
search_comp_group,
setup_logging,
trace,
trace_targets,
validate_ccd_region,
write_fits)


def fake_subprocess_popen(*args, stdout, stderr):
Expand Down Expand Up @@ -233,9 +233,9 @@ class ClassifySpectroscopicData(TestCase):
def setUp(self):
self.path = os.path.join(
os.getcwd(),
'goodman_pipeline/data/test_data/test_classify_spectroscopic');
'test_classify_spectroscopic')
if not os.path.isdir(self.path):
os.mkdir(self.path)
os.makedirs(self.path)

def tearDown(self):
if os.path.isdir(self.path):
Expand Down Expand Up @@ -1386,11 +1386,13 @@ def tearDown(self):
self.assertFalse(os.path.isfile(norm_flat))

def test_get_best_flat(self):
# print(self.flat_name_base)
print(self.flat_name_base)
print(os.path.dirname(__file__))

master_flat, master_flat_name = get_best_flat(
flat_name=self.flat_name_base,
path=self.flat_path)
print(master_flat_name)
self.assertIsInstance(master_flat, CCDData)
self.assertEqual(os.path.basename(master_flat_name),
self.reference_flat_name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from ccdproc import CCDData
from unittest import TestCase, skip

from ..data_classifier import DataClassifier
from goodman_pipeline.images.data_classifier import DataClassifier


class DataClassifierTests(TestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import absolute_import
from unittest import TestCase, skip

from ..goodman_ccd import get_args, MainApp
from goodman_pipeline.images.goodman_ccd import get_args, MainApp


class MainAppTest(TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from unittest import TestCase, skip

from ccdproc import CCDData
from ...core import NightDataContainer
from ..image_processor import ImageProcessor
from ..goodman_ccd import get_args
from goodman_pipeline.core import NightDataContainer
from goodman_pipeline.images.image_processor import ImageProcessor
from goodman_pipeline.images.goodman_ccd import get_args

import numpy as np

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from ccdproc import CCDData
from unittest import TestCase, skip

from ..night_organizer import NightOrganizer
from goodman_pipeline.images.night_organizer import NightOrganizer


def create_fake_data(technique, instrument, path):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import shutil
from unittest import TestCase

from ...spectroscopy.redspec import (get_args, MainApp)
from goodman_pipeline.spectroscopy.redspec import (get_args, MainApp)


class TestArguments(TestCase):
Expand Down Expand Up @@ -103,8 +103,8 @@ def test_destination_path_sysexit(self):


def test_get_args():
from ...spectroscopy.redspec import get_args
import argparse
# from ...spectroscopy.redspec import get_args
# import argparse
arguments = ['--data-path', './',
'--proc-path', './',
'--search-pattern', 'test-pattern',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
from astropy.modeling import models, Model
from ccdproc import CCDData
from unittest import TestCase, skip
from ..wavelength import (WavelengthCalibration)
from goodman_pipeline.spectroscopy.wavelength import (WavelengthCalibration)

from ..redspec import get_args
from ...core import add_wcs_keys, write_fits
from ...core import ReferenceData, NoMatchFound
from goodman_pipeline.spectroscopy.redspec import get_args
from goodman_pipeline.core import add_wcs_keys, write_fits
from goodman_pipeline.core import ReferenceData, NoMatchFound


class WavelengthCalibrationTests(TestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import absolute_import

from unittest import TestCase, skip
from ..wcs import WCS
from goodman_pipeline.wcs.wcs import WCS
import numpy as np
import os
import re
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import absolute_import

from unittest import TestCase, skip
from ..wcs import WCS
from goodman_pipeline.wcs.wcs import WCS
import numpy as np
import os
import re
Expand Down
2 changes: 1 addition & 1 deletion goodman_pipeline/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This is an automatic generated file please do not edit
__version__ = '1.3.2.dev1'
__version__ = '1.3.2'
1 change: 0 additions & 1 deletion goodman_pipeline/wcs/tests/__init__.py

This file was deleted.

7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[build-system]

requires = ["setuptools",
"setuptools_scm",
"wheel"]

build-backend = 'setuptools.build_meta'
22 changes: 20 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ license = BSD-3-Clause
# url =
edit_on_github = False
github_project = soar-telescope/goodman_pipeline

# version should be PEP440 compatible (http://www.python.org/dev/peps/pep-0440)
version = 1.3.2

[options]
zip_safe = False
include_package_data = True
packages = find:
python_requires = >=3.6
setup_requires = setuptools_scm
install_requires =
numpy
pandas
Expand All @@ -31,5 +41,13 @@ install_requires =
astropy
ccdproc
astroplan
# version should be PEP440 compatible (http://www.python.org/dev/peps/pep-0440)
version = 1.3.2

# [options.entry_points]
# console_scripts =
# astropy-package-template-example = packagename.example_mod:main

[options.extras_require]
test =
requests
docs =
sphinx-astropy
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def create_version_py(packagename, version, source_dir='.'):
# conf.read([os.path.join(os.path.dirname(__file__), '..', 'setup.cfg')])
conf.read([os.path.join(os.path.dirname(__file__), 'setup.cfg')])
metadata = dict(conf.items('metadata'))
options = dict(conf.items('options'))

PACKAGENAME = metadata['package_name']

Expand All @@ -65,7 +66,7 @@ def create_version_py(packagename, version, source_dir='.'):

AUTHOR_EMAIL = metadata['author_email']

INSTALL_REQUIRES = metadata['install_requires'].split()
INSTALL_REQUIRES = options['install_requires'].split()

# freezes version information in version.py
create_version_py(PACKAGENAME, VERSION)
Expand Down
Loading