Skip to content

Commit 703b499

Browse files
committed
Add changes to framework not staged
1 parent b909316 commit 703b499

11 files changed

+174
-762
lines changed

.travis.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ cache:
77
sudo: false
88

99
python:
10-
- '2.7'
11-
- '3.5'
12-
- '3.6'
10+
- '3.7'
11+
- '3.8'
1312

1413
os:
1514
- linux
16-
15+
g
1716
matrix:
1817
fast_finish: true
1918

@@ -29,11 +28,11 @@ install:
2928
- pip install --upgrade setuptools --quiet
3029
- pip install pytest
3130
- pip install pytest-coverage
32-
- pip install coveralls
31+
- pip install codecov
3332
- pip install .[dev]
3433

3534
script:
36-
- pytest python/target_selection/tests --cov python/target_selection --cov-report html
35+
- pytest tests --cov target_selection --cov-report html
3736

3837
after_success:
39-
- coveralls
38+
- codecov

CHANGELOG.rst

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
=========
2-
Changelog
3-
=========
1+
.. _target_selection-changelog:
2+
3+
==========
4+
Change Log
5+
==========
46

57
* Basic framework.

MANIFEST.in

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
recursive-include python/target_selection/etc *
2+
recursive-include cextern/**/*

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
target_selection
2-
==========================
1+
# target_selection
32

4-
[![Documentation Status](https://readthedocs.org/projects/target_selection/badge/?version=latest)](https://target_selection.readthedocs.io/en/latest/?badge=latest)
5-
[![Coveralls](https://coveralls.io/repos/github/sdss/target_selection/badge.svg?branch=master)](https://coveralls.io/github/sdss/target_selection?branch=master)
6-
[![Travis](https://travis-ci.org/sdss/target_selection.svg?branch=master)](https://travis-ci.org/sdss/target_selection)
3+
![Versions](https://img.shields.io/badge/python->3.7-blue)
4+
[![Documentation Status](https://readthedocs.org/projects/sdss-target-selection/badge/?version=latest)](https://sdss-target-selection.readthedocs.io/en/latest/?badge=latest)
5+
[![Travis (.org)](https://img.shields.io/travis/sdss/target_selection)](https://travis-ci.org/sdss/target_selection)
6+
[![codecov](https://codecov.io/gh/sdss/target_selection/branch/master/graph/badge.svg)](https://codecov.io/gh/sdss/target_selection)
77

8-
Code to perform target selection for BHM/MWM using catalogdb
8+
Code to perform target selection for BHM/MWM using catalogdb.
99

10-
Start off by importing existing efforts from bhm_targeting
10+
Start off by importing existing efforts from bhm_targeting.

STYLE.rst

-527
This file was deleted.

python/target_selection/__init__.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
# encoding: utf-8
22

3-
from __future__ import absolute_import, division, print_function, unicode_literals
3+
from sdsstools import get_config, get_logger, get_package_version
44

5-
from .utils import get_config, get_logger
6-
7-
8-
NAME = 'target_selection'
95

6+
NAME = 'sdss-target-selection'
107

118
# Loads config
129
config = get_config(NAME)
1310

14-
1511
# Inits the logging system. Only shell logging, and exception and warning catching.
1612
# File logging can be started by calling log.start_file_logger(path).
1713
log = get_logger(NAME)
1814

1915

20-
__version__ = '0.1.0dev'
16+
__version__ = get_package_version(path=__file__, package_name=NAME)

python/target_selection/exceptions.py

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# !usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
#
4+
# Licensed under a 3-clause BSD license.
5+
#
6+
# @Author: Brian Cherinka
7+
# @Date: 2017-12-05 12:01:21
8+
# @Last modified by: Brian Cherinka
9+
# @Last Modified time: 2017-12-05 12:19:32
10+
11+
from __future__ import print_function, division, absolute_import
12+
13+
14+
class Target_selectionError(Exception):
15+
"""A custom core Target_selection exception"""
16+
17+
def __init__(self, message=None):
18+
19+
message = 'There has been an error' \
20+
if not message else message
21+
22+
super(Target_selectionError, self).__init__(message)
23+
24+
25+
class Target_selectionNotImplemented(Target_selectionError):
26+
"""A custom exception for not yet implemented features."""
27+
28+
def __init__(self, message=None):
29+
30+
message = 'This feature is not implemented yet.' \
31+
if not message else message
32+
33+
super(Target_selectionNotImplemented, self).__init__(message)
34+
35+
36+
class Target_selectionAPIError(Target_selectionError):
37+
"""A custom exception for API errors"""
38+
39+
def __init__(self, message=None):
40+
if not message:
41+
message = 'Error with Http Response from Target_selection API'
42+
else:
43+
message = 'Http response error from Target_selection API. {0}'.format(message)
44+
45+
super(Target_selectionAPIError, self).__init__(message)
46+
47+
48+
class Target_selectionApiAuthError(Target_selectionAPIError):
49+
"""A custom exception for API authentication errors"""
50+
pass
51+
52+
53+
class Target_selectionMissingDependency(Target_selectionError):
54+
"""A custom exception for missing dependencies."""
55+
pass
56+
57+
58+
class Target_selectionWarning(Warning):
59+
"""Base warning for Target_selection."""
60+
61+
62+
class Target_selectionUserWarning(UserWarning, Target_selectionWarning):
63+
"""The primary warning class."""
64+
pass
65+
66+
67+
class Target_selectionSkippedTestWarning(Target_selectionUserWarning):
68+
"""A warning for when a test is skipped."""
69+
pass
70+
71+
72+
class Target_selectionDeprecationWarning(Target_selectionUserWarning):
73+
"""A warning for deprecated features."""
74+
pass

requirements.txt

-7
This file was deleted.

setup.cfg

+73-62
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,114 @@
11
[metadata]
2-
name = sdss-target_selection
3-
version = 0.1.0dev
2+
name = sdss-target-selection
3+
version = 0.1.0-alpha.0
44
author = José Sánchez-Gallego
55
author_email = [email protected]
66
description = Code to perform target selection for BHM/MWM using catalogdb
77
url = https://github.com/sdss/target_selection
88
project_urls =
9-
Repository = https://github.com/sdss/target_selection
10-
Documentation = sdss-target_selection.readthedocs.org
9+
Repository = https://github.com/sdss/target_selection
10+
Documentation = https://sdss-target-selection.readthedocs.org
1111
long_description = file: README.md
1212
long_description_content_type = text/markdown
1313
keywords = astronomy, software
1414
license = BSD 3-Clause License
1515
license_file = LICENSE.md
1616
classifiers =
17-
Development Status :: 4 - Beta
18-
Intended Audience :: Science/Research
19-
Natural Language :: English
20-
Operating System :: OS Independent
21-
Topic :: Documentation :: Sphinx
22-
Topic :: Software Development :: Libraries :: Python Modules
17+
Intended Audience :: Science/Research
18+
Natural Language :: English
19+
Operating System :: OS Independent
20+
Programming Language :: Python
21+
Programming Language :: Python :: 3.6
22+
Programming Language :: Python :: 3.7
23+
Programming Language :: Python :: 3.8
24+
Topic :: Documentation :: Sphinx
25+
Topic :: Software Development :: Libraries :: Python Modules
2326

2427
[options]
2528
zip_safe = False
26-
python_requires = >=3.7
27-
include_package_data = True
28-
package_dir=
29-
= python
29+
python_requires = >=3.6
3030
packages = find:
31+
package_dir =
32+
= python
3133
install_requires =
32-
numpy
33-
pyyaml
34-
pygments>=2.2.0
34+
sdss-tree>=2.15.2
35+
sdss-access>=0.2.3
36+
sdsstools>=0.1.0
37+
scripts =
38+
bin/target_selection
3539

3640
[options.packages.find]
37-
where = python
38-
exclude =
39-
*.tests
41+
where =
42+
python
4043

4144
[options.package_data]
4245
target_selection =
4346
etc/*
44-
masks/*
45-
4647

4748
[options.extras_require]
4849
dev =
49-
flake8
50-
ipython
51-
pytest
52-
pytest-cov
53-
pytest-sugar
54-
invoke
55-
bump2version
56-
wheel
57-
doc8
58-
50+
%(docs)s # This forces the docs extras to install (http://bit.ly/2Qz7fzb)
51+
ipython>=7.9.0
52+
matplotlib>=3.1.1
53+
flake8>=3.7.9
54+
doc8>=0.8.0
55+
pytest>=5.2.2
56+
pytest-asyncio>=0.10.0
57+
pytest-cov>=2.8.1
58+
pytest-mock>=1.13.0
59+
pytest-sugar>=0.9.2
60+
isort>=4.3.21
61+
codecov>=2.0.15
62+
coverage[toml]>=5.0
63+
ipdb>=0.12.3
64+
sdsstools[dev]>=0.1.0
65+
# The following are needed because sdsstools[dev] as an extra not always
66+
# gets installed. See https://github.com/pypa/pip/issues/4957.
67+
invoke>=1.3.0
68+
twine>=3.1.1
69+
wheel>=0.33.6
5970
docs =
60-
Sphinx>=1.8.0
61-
releases>=1.6.1
62-
sphinxcontrib-trio>=1.0.1
63-
sphinx-click>=1.3.0
64-
71+
Sphinx>=2.1.0
72+
sphinx_bootstrap_theme>=0.4.12
6573

6674
[isort]
67-
line_length=99
68-
lines_after_imports=2
69-
use_parentheses=true
70-
balanced_wrapping=true
71-
75+
line_length = 79
76+
sections =
77+
FUTURE
78+
STDLIB
79+
THIRDPARTY
80+
SDSS
81+
FIRSTPARTY
82+
LOCALFOLDER
83+
default_section = THIRDPARTY
84+
known_first_party = target_selection
85+
known_sdss_party =
86+
sdssdb
87+
balanced_wrapping = true
88+
include_trailing_comma = false
89+
lines_after_imports = 2
90+
use_parentheses = true
7291

7392
[flake8]
7493
ignore =
7594
H101
7695
E722
7796
W504
7897
W505
98+
per-file-ignores =
99+
*/__init__.py:E,W
79100
max-line-length = 99
80101

81-
82-
[bumpversion]
83-
current_version = 0.1.0dev
84-
commit = True
85-
tag = False
86-
tag_name = {new_version}
87-
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?P<release>[a-z]+)?
88-
serialize =
89-
{major}.{minor}.{patch}{release}
90-
{major}.{minor}.{patch}
91-
92-
[bumpversion:part:release]
93-
optional_value = alpha
94-
values =
95-
dev
96-
alpha
97-
98-
[bumpversion:file:python/target_selection/__init__.py]
99-
[bumpversion:file:setup.cfg]
100-
102+
[tool:pytest]
103+
addopts = --cov target_selection --cov-report html -W ignore
101104

102105
[coverage:run]
103106
branch = true
107+
include =
108+
python/target_selection/*
109+
omit =
110+
*/utils/*.py
111+
*/__init__.py
112+
113+
[coverage:report]
114+
exclude_lines =

setup.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
#!/usr/bin/env python
2-
# -*- coding: utf-8 -*-
1+
# encoding: utf-8
32
#
4-
# @Author: José Sánchez-Gallego ([email protected])
5-
# @Date: 2019-08-03
6-
# @Filename: setup.py
7-
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
3+
# setup.py
84
#
9-
# @Last modified by: José Sánchez-Gallego ([email protected])
10-
# @Last modified time: 2019-08-03 15:42:18
115

126
from setuptools import setup
7+
8+
139
setup()

0 commit comments

Comments
 (0)