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

Issue hotfix #198

Merged
merged 7 commits into from
Jul 15, 2024
Merged
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
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
CTLearn: Deep Learning for IACT Event Reconstruction
====================================================

.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3342952.svg
:target: https://doi.org/10.5281/zenodo.3342952
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.11475531.svg
:target: https://doi.org/10.5281/zenodo.11475531
:alt: DOI


Expand Down Expand Up @@ -37,7 +37,7 @@ necessary package channels, and install CTLearn specified version and its depend

.. code-block:: bash

CTLEARN_VER=0.8.0
CTLEARN_VER=0.9.0
wget https://raw.githubusercontent.com/ctlearn-project/ctlearn/v$CTLEARN_VER/environment.yml
conda env create -n [ENVIRONMENT_NAME] -f environment.yml
conda activate [ENVIRONMENT_NAME]
Expand All @@ -54,10 +54,10 @@ Citing this software

Please cite the corresponding version using the DOIs below if this software package is used to produce results for any publication:

.. |zendoi070| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.7908252.svg
:target: https://doi.org/10.5281/zenodo.7908252
.. |zendoi080| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.11475531.svg
:target: https://doi.org/10.5281/zenodo.11475531

* 0.7.0 : |zendoi070|
* 0.8.0 : |zendoi080|

Team
----
Expand Down
5 changes: 4 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ pip
pyyaml
scikit-learn
tensorflow
tf2onnx
ctaplot
dl1_data_handler
numba
pydot
pyirf
53 changes: 53 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[build-system]
requires = ["setuptools >= 65", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[project]
name = "CTLearn"
description = "CTLearn is a package under active development to run deep learning models to analyze data from all major current and future arrays of imaging atmospheric Cherenkov telescopes (IACTs)."
readme = "README.md"
license = {text = "BSD-3-Clause"}
authors = [
{name = "Ari Brill"},
{name = "Bryan Kim"},
{name = "Tjark Miener"},
{name = "Daniel Nieto"}
]

classifiers = [
"License :: OSI Approved :: BSD License",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Astronomy",
"Topic :: Scientific/Engineering :: Physics",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]

requires-python = ">=3.10"
dependencies = [
"dl1_data_handler>=0.12.0",
"astropy",
"matplotlib",
"numpy",
"pandas",
"pip",
"pyyaml",
"scikit-learn",
"ctaplot",
"numba>=0.56.2,<0.57",
"tensorflow>=2.15,<2.16",
"pydot",
"pyirf",
]

dynamic = ["version"]

[project.urls]
repository = "https://github.com/ctlearn-project/ctlearn"
documentation = "https://ctlearn.readthedocs.io/en/latest/"

[project.scripts]
ctlearn="ctlearn.run_model:main"
build_irf="ctlearn.build_irf:main"
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ def getVersionFromFile():

here = path.abspath(path.dirname(__file__))

def getRequirements():
return open("docs/requirements.txt").readlines()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requirements for building the docs should go into the project.optional-dependencies section of pyproject.toml

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

@rcervinoucm rcervinoucm Jul 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have the dependencies in the setup.py and in the dependencies section in the pyproject.toml file, they should also be included in the optional-dependencies? In our case they are not optional

dependencies = [
"dl1_data_handler>=0.12.0",
"astropy",
"matplotlib",
"numpy",
"pandas",
"pip",
"pyyaml",
"scikit-learn",
"ctaplot",
"numba>=0.56.2,<0.57",
"tensorflow>=2.15,<2.16",
"pydot",
"pyirf",
]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I misunderstood then. I thought docs/requirements.txt are additional requirements that are needed to build the documentation (e.g. sphinx)


with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()

Expand All @@ -22,9 +25,11 @@ def getVersionFromFile():
url='https://github.com/ctlearn-project/ctlearn',
license='BSD-3-Clause',
packages=['ctlearn'],
install_requires=getRequirements(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not duplicate information between pyproject.toml and setup.py.

This can lead to confusion and errors.

After you introduced pyproject.toml with all the configurations you provided, you should just remove the setup.py.

entry_points = {
'console_scripts': ['ctlearn=ctlearn.run_model:main',
'build_irf=ctlearn.build_irf:main'],
},

dependency_links=[],
zip_safe=True)