Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleLochner committed Jun 5, 2023
2 parents 7992977 + abe55ba commit 27686c1
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 37 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Setting up github action for pypi

name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
35 changes: 13 additions & 22 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
###### Requirements without Version Specifiers ######
iminuit
lightgbm
scikit-learn
seaborn
setuptools_scm

###### Requirements with Version Specifiers ######
astropy>=1.1.2
jupyter>=1.0.0
future>=0.16
george>=0.3.0
matplotlib>=1.5.1
nose>=1.3.7
numpy>=1.18.4
scikit-learn>=0.20.0
scipy>=0.17.0
george>=0.3.0
iminuit>=1.2
pandas>=0.23.0
extinction>=0.3.0
imbalanced-learn>=0.4.3
# python==3.7
pip>=20.1
emcee>=2.1.0
numpydoc>=0.6.0
pytest-remotedata>=0.3.1
pyyaml>=3.13
pywavelets>=0.4.0
scipy>=0.17.0
sncosmo>=2.1.0
nose>=1.3.7
future>=0.16
pyyaml>=3.13
pytest-xdist>=1.26.1
seaborn
schwimmbad
# cesium
tqdm
lightgbm
ipympl
36 changes: 27 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from setuptools import setup
from setuptools import setup, find_packages
from setuptools.command.install import install
import sys
import os
Expand All @@ -7,7 +7,7 @@


PACKAGENAME = 'snmachine'
__FALLBACK_VERSION__ = '2.0.0'
__FALLBACK_VERSION__ = '2.1.0'


class ExtractExampleData(install):
Expand Down Expand Up @@ -37,22 +37,40 @@ def run(self):

setup(
name='snmachine',
author='Michelle Lochner et al.',
author_email='[email protected]',
description='Machine learning code for photometric supernova '
'classification',
url='https://github.com/LSSTDESC/snmachine',
license='BSD-3-Clause License',
description='Machine learning code for photometric supernova '
'classification',
use_scm_version={
"root": ".",
"relative_to": __file__,
"fallback_version": __FALLBACK_VERSION__},
setup_requires=['setuptools_scm>=3.2.0'],
packages=['snmachine', 'utils'],
packages=find_packages(),
include_package_data=True,
package_data={'snmachine': ['example_data/SPCC_SUBSET.tar.gz',
'example_data/output_spcc_no_z/features/*.dat',
'example_data/example_data_for_tests.pckl']},
exclude_package_data={'utils': ['archive/*']},
cmdclass={'install': ExtractExampleData},
url='https://github.com/LSSTDESC/snmachine',
license='BSD-3-Clause License',
author='Michelle Lochner et al.',
author_email='[email protected]',
description='Machine learning code for photometric supernova '
'classification'
install_requires=['astropy>=1.1.2',
'matplotlib>=3.0.0',
'numpy>=1.18.4',
'scikit-learn',
'scipy>=1.4.0',
'george>=0.3.0',
'iminuit',
'pandas>=0.23.0',
'pywavelets>=0.4.0',
'sncosmo>=2.1.0',
'nose>=1.3.7',
'future>=0.16',
'pyyaml>=3.13',
'seaborn',
'lightgbm',
'setuptools_scm']
)
2 changes: 1 addition & 1 deletion snmachine/snclassifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from sklearn import model_selection
from sklearn.model_selection import PredefinedSplit, StratifiedKFold
from sklearn.preprocessing import StandardScaler
from utils import plasticc_utils
from snmachine.utils import plasticc_utils

# This allows the user to easily loop through all possible classifiers
choice_of_classifiers = ['svm', 'knn', 'random_forest', 'decision_tree',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@

from argparse import ArgumentParser
# not used at the moment
from imblearn.metrics import classification_report_imbalanced
# from imblearn.over_sampling import SMOTE
from imblearn.pipeline import make_pipeline
# from utils.plasticc_utils import plasticc_log_loss
from utils.plasticc_utils import plot_confusion_matrix
#from imblearn.metrics import classification_report_imbalanced
#from imblearn.over_sampling import SMOTE
#from imblearn.pipeline import make_pipeline
from snmachine.utils.plasticc_utils import plot_confusion_matrix
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split

Expand Down
File renamed without changes.

0 comments on commit 27686c1

Please sign in to comment.