Skip to content

Commit

Permalink
Merge pull request #16 from sschmidt23/main
Browse files Browse the repository at this point in the history
Update License and structure to prepare for PyPI
  • Loading branch information
sschmidt23 authored Aug 29, 2022
2 parents c2a3857 + 17d7835 commit fb2b59c
Show file tree
Hide file tree
Showing 37 changed files with 63 additions and 48 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

name: Continuous Integration

on:
Expand Down Expand Up @@ -34,9 +35,10 @@ jobs:
- name: Run test script
run: |
cd src/desc_bpz/data_files/
export BPZDATAPATH=$PWD
cd tests
python ../scripts/bpz.py test1000.h5 -P test1000.pars
cd ../../../tests
python ../src/desc_bpz/scripts/bpz.py test1000.h5 -P test1000.pars
- name: Run other tests
run: |
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ If you use this code, please cite [Benitez (2000)](https://ui.adsabs.harvard.edu
In order to run, you should set the environment variable


`BPZDATAPATH` to point to the directory housing the SED, FILTER, and AB files.
`BPZDATAPATH` to point to the directory housing the SED, FILTER, and AB files. Default SED and FILTER files are available in the
`src/desc_bpz/data_files/FILTER` and `src/desc_bpz/data_files/SED` directories


To run traditional command-line `BPZ` use the `bpz.py` file in `scripts`, e.g.:
To run traditional command-line `BPZ` use the `bpz.py` file in `src/desc_bpz/scripts`, e.g.:


`python scripts/bpz.py yourasciicatalog.cat -P yourparameterfile.pars`
`python src/desc_bpz/scripts/bpz.py yourasciicatalog.cat -P yourparameterfile.pars`


Dan Coe's STScI webpage listed above contains a nice BPZ user guide, for more detail on running the code, please check that website.
Dan Coe's STScI webpage (listed above) contains a nice BPZ user guide, for more detail on running the code, please check that website.


However, this package will mainly be used as a library for running "bpz_lite" in the DESC PZ RAIL Package, see:
Expand Down
50 changes: 50 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[project]
name = "desc_bpz"
description = "Python3 version of BPZ used in DESC"
version = "0.2"
readme = "README.md"
requires-python = ">=3.5"
license = { file = "LICENSE" }
authors = [
{name = "Noel Benitez, Dan Coe, Will Hartley, Sam Schmidt, Joe Zuntz, LSST DESC PZWG", email = "[email protected]"}
]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Natural Language :: English",
"Operating System :: OS Independent"
]
dependencies = [
"numpy",
"scipy",
"pandas>=1.1",
"h5py",
]

[project.optional-dependencies]
dev = [
"pytest",
"pytest-runner",
]

[build-system]
requires = ["setuptools", "wheel", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages.find]
where = ["src", "tests"]

[tool.setuptools.package-data]
"*" = ["*.h5", "*.yaml", "*.columns", "*.pars"]
"desc_bpz.data_files.SED" = ["*.sed", "*.list"]
"desc_bpz.data_files.AB" = ["*.AB"]
"desc_bpz.data_files.FILTER" = ["*.res"]
"desc_bpz.scripts" = ["*.columns", "*.pars"]
42 changes: 2 additions & 40 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,41 +1,3 @@
from setuptools import setup, find_namespace_packages
from setuptools import setup

packages = find_namespace_packages()
setup(
name="desc_bpz",
version="0.1",
author="Noel Benitez, Dan Coe, Will Hartley,"
"Sam Schmidt, LSST DESC PZWG",
author_email="[email protected]",
packages=packages,
package_data={
"": ["*.h5", "*.yaml", "*.sed", "*.res",
"*.AB", "*.columns", "*.pars"],
"tests": ["*.h5", "*.yaml"],
"SED": ["*.sed"],
"FILTER": ["*.res"],
"AB": ["*.AB"],
"scripts": ["*.columns, *.pars"]
},
include_package_data=True,
license="MIT License",
description="Python3 version of BPZ used in DESC",
url="https://github.com/LSSTDESC/DESC_BPZ",
long_description=open("README.md").read(),
classifiers=[
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python"
],
install_requires=['numpy',
'scipy',
'pandas>=1.1',
'h5py',
],
python_requires='>=3.5',
setup_requires=['pytest-runner'],
tests_require=['pytest'],
)
setup()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion desc_bpz/version.py → src/desc_bpz/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# just set version manually for now
__version__ = "0.1"
__version__ = "0.2"
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_paths.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import pytest
dirname, _ = os.path.split(__file__)
parent = os.path.join(dirname, '..')
parent = os.path.join(dirname, '../src/desc_bpz/data_files/')


# This test has to go first
Expand Down

0 comments on commit fb2b59c

Please sign in to comment.