Skip to content

Commit

Permalink
Fix editable installs by switching to src layout, fixes #162
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe committed Dec 6, 2022
1 parent 9850463 commit b993de0
Show file tree
Hide file tree
Showing 29 changed files with 78 additions and 30 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ jobs:
pip install pytest-cov "git+https://github.com/cta-observatory/ctapipe@$CTAPIPE_VERSION"
git describe --tags
- name: Test Plugin
shell: bash -l {0}
run: |
# check the LSTEventSource is available for LST
python eventsource_subclasses.py | grep LSTEventSource
- name: Download test data
env:
TEST_DATA_USER: ${{ secrets.test_data_user }}
Expand Down
5 changes: 5 additions & 0 deletions eventsource_subclasses.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from ctapipe.io import EventSource
from ctapipe.core import non_abstract_children

for cls in non_abstract_children(EventSource):
print(cls.__name__)
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[build-system]
requires = ["setuptools >= 40.6.0", "wheel", "setuptools_scm[toml]>=3.4"]
requires = ["setuptools >= 64.0.3", "setuptools_scm[toml]>=3.4"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "src/ctapipe_io_lst/_version.py"
48 changes: 45 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,58 @@ name = ctapipe_io_lst
description = ctapipe plugin for reading LST prototype files
long_description = file: README.md
long_description_content_type = text/markdown; charset=UTF-8; variant=GFM
author = LST Consortium
author_email = [email protected]
author = CTA LST Project
author_email = [email protected]
license = MIT

project_urls =
Bug Tracker = https://github.com/cta-observatory/ctapipe_io_lst/issues
Source Code = https://github.com/cta-observatory/ctapipe_io_lst

classifiers =
Development Status :: 4 - Beta
License :: OSI Approved :: MIT License
Intended Audience :: Science/Research
Topic :: Scientific/Engineering :: Astronomy
Topic :: Scientific/Engineering :: Physics
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10


[options]
packages = find:
package_dir =
= src
python_requires = >=3.8
zip_safe = False
install_requires=
astropy~=5.0
ctapipe~=0.17.0
protozfits~=2.0
numpy>=1.20

[options.package_data]
* = resources/*

[options.packages.find]
exclude =
ctapipe_io_lst._dev_version

[options.extras_require]
tests =
pytest
dev =
setuptools_scm[toml]
all =
%(tests)s
%(dev)s

[tool:pytest]
minversion = 3.0
addopts = -v


[aliases]
test = pytest

Expand Down
21 changes: 2 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,2 @@
from setuptools import setup, find_packages
import os

setup(
packages=find_packages(exclude=["ctapipe_io_lst._dev_version"]),
use_scm_version={"write_to": os.path.join("ctapipe_io_lst", "_version.py")},
python_requires=">=3.8",
install_requires=[
'astropy~=5.0',
'ctapipe~=0.17.0',
'protozfits~=2.0',
'setuptools_scm',
'numpy>=1.20'
],
package_data={
'ctapipe_io_lst': ['resources/*'],
},
tests_require=['pytest'],
)
from setuptools import setup
setup()
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions src/ctapipe_io_lst/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
__version__ = version = '0.19a1.dev1+g3796a1c2.d20221206'
__version_tuple__ = version_tuple = (0, 19, 'dev1', 'g3796a1c2.d20221206')
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.
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
test_data = Path(os.getenv('LSTCHAIN_TEST_DATA', 'test_data'))
test_r0_path = test_data / 'real/R0/20200218/LST-1.1.Run02008.0000_first50.fits.fz'
test_r0_calib_path = test_data / 'real/R0/20200218/LST-1.1.Run02006.0004.fits.fz'
test_calib_path = test_data / 'real/monitoring/PixelCalibration/LevelA/calibration/20200218/v0.8.2.post2.dev48+gb1343281/calibration_filters_52.Run02006.0000.h5'
test_drs4_pedestal_path = test_data / 'real/monitoring/PixelCalibration/LevelA/drs4_baseline/20200218/v0.8.2.post2.dev48+gb1343281/drs4_pedestal.Run02005.0000.h5'
test_time_calib_path = test_data / 'real/monitoring/PixelCalibration/LevelA/drs4_time_sampling_from_FF/20191124/v0.8.2.post2.dev48+gb1343281/time_calibration.Run01625.0000.h5'
test_missing_module_path = test_data / 'real/R0/20210215/LST-1.1.Run03669.0000_first50.fits.fz'
test_r0_gainselected_path = test_data / 'real/R0/20200218/LST-1.1.Run02008.0000_first50_gainselected.fits.fz'


calib_version = "ctapipe-v0.17"
calib_path = test_data / 'real/monitoring/PixelCalibration/Cat-A/'
test_calib_path = calib_path / f'calibration/20200218/{calib_version}/calibration_filters_52.Run02006.0000.h5'
test_drs4_pedestal_path = calib_path / f'drs4_baseline/20200218/{calib_version}/drs4_pedestal.Run02005.0000.h5'
test_time_calib_path = calib_path / f'drs4_time_sampling_from_FF/20191124/{calib_version}/time_calibration.Run01625.0000.h5'


def test_get_first_capacitor():
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@

test_data = Path(os.getenv('LSTCHAIN_TEST_DATA', 'test_data'))
test_r0_path = test_data / 'real/R0/20200218/LST-1.1.Run02008.0000_first50.fits.fz'
test_calib_path = test_data / 'real/monitoring/PixelCalibration/LevelA/calibration/20200218/v0.8.2.post2.dev48+gb1343281/calibration_filters_52.Run02006.0000.h5'
test_drs4_pedestal_path = test_data / 'real/monitoring/PixelCalibration/LevelA/drs4_baseline/20200218/v0.8.2.post2.dev48+gb1343281/drs4_pedestal.Run02005.0000.h5'
test_time_calib_path = test_data / 'real/monitoring/PixelCalibration/LevelA/drs4_time_sampling_from_FF/20191124/v0.8.2.post2.dev48+gb1343281/time_calibration.Run01625.0000.h5'
test_drive_report = test_data / 'real/monitoring/DrivePositioning/DrivePosition_log_20200218.txt'
test_run_summary = test_data / 'real/monitoring/RunSummary/RunSummary_20200218.ecsv'

calib_version = "ctapipe-v0.17"
calib_path = test_data / 'real/monitoring/PixelCalibration/Cat-A/'
test_calib_path = calib_path / f'calibration/20200218/{calib_version}/calibration_filters_52.Run02006.0000.h5'
test_drs4_pedestal_path = calib_path / f'drs4_baseline/20200218/{calib_version}/drs4_pedestal.Run02005.0000.h5'
test_time_calib_path = calib_path / f'drs4_time_sampling_from_FF/20191124/{calib_version}/time_calibration.Run01625.0000.h5'


def test_stage1(tmp_path):
"""Test the ctapipe stage1 tool can read in LST real data using the event source"""
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit b993de0

Please sign in to comment.