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

Updates to lstchain v0.10.0 #211

Merged
merged 15 commits into from
Jun 20, 2023
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
11 changes: 6 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up Python 3.8
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.11

- name: pyflakes
run: |
Expand All @@ -42,14 +42,15 @@ jobs:
fetch-depth: 0

- name: Setup Mamba
uses: mamba-org/provision-with-micromamba@v14
uses: mamba-org/setup-micromamba@v1
with:
environment-name: "osa-ci"
environment-file: environment.yml
cache-environment: true
post-cleanup: 'all'

- name: Install dependencies
env:
PYTHON_VERSION: 3.8
PYTHON_VERSION: 3.11

run: |
python --version
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2

python:
version: 3.8
version: 3.11
install:
- method: pip
path: .
Expand Down
30 changes: 14 additions & 16 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,43 @@
name: osa-dev
channels:
- conda-forge
- default
dependencies:
# core dependencies
- python=3.8
- numpy=1.21
- python=3.11
- numpy
- pip
- astropy~=4.2
- ctapipe~=0.12
- protozfits=2.0
- matplotlib=3.5
- astropy~=5.0
- ctapipe~=0.19.2
- matplotlib=3.7
- pyparsing
- prov
- pyyaml
- pydot
- pydotplus
- psutil
- gammapy=0.19
- gammapy=1.1
- h5py
- joblib
- joblib~=1.2.0
- click
- pymongo
- scikit-learn=1.0
- scikit-learn=1.2
- protobuf=3.20
# dev dependencies
- pre-commit
- pytest
- pytest-cov
- coverage=6.2
- coverage
- black
- isort
- sphinx
- sphinx=4
- sphinx_rtd_theme
- sphinx-automodapi
- sphinx-argparse
- sphinx-autoapi
- ctapipe_io_lst=0.21.1
- pip:
- lstchain~=0.9.6
- lstchain~=0.10.0
- pytest_runner
- pytest-ordering
- ctapipe_io_lst~=0.18.1
- ctaplot~=0.5.5
- pyirf~=0.6.0
- ctaplot~=0.6.2
- pyirf~=0.8.0
4 changes: 2 additions & 2 deletions osa/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ def run_squeue() -> StringIO:
log.warning("No job info available since squeue command is not available")
return StringIO()

out_fmt = "%i,%j,%T,%M" # JOBID, NAME, STATE, TIME
out_fmt = "%i;%j;%T;%M" # JOBID, NAME, STATE, TIME
return StringIO(sp.check_output(["squeue", "--me", "-o", out_fmt]).decode())


Expand All @@ -627,7 +627,7 @@ def get_squeue_output(squeue_output: StringIO) -> pd.DataFrame:
Obtain the current job information from squeue output
and return a pandas dataframe.
"""
df = pd.read_csv(squeue_output)
df = pd.read_csv(squeue_output, delimiter=";")
df.rename(
inplace=True,
columns={
Expand Down
3 changes: 1 addition & 2 deletions osa/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,8 @@ def calibration_file_exists(run_id: int) -> bool:

def get_drive_file(date: str) -> Path:
"""Return the drive file corresponding to a given date in YYYYMMDD format."""
yy_mm_dd = utils.date_in_yymmdd(date)
drive_dir = Path(cfg.get("LST1", "DRIVE_DIR"))
return (drive_dir / f"drive_log_{yy_mm_dd}.txt").resolve()
return (drive_dir / f"DrivePosition_log_{date}.txt").resolve()


def get_summary_file(date) -> Path:
Expand Down
6 changes: 0 additions & 6 deletions osa/utils/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ def test_get_calib_prod_id():
assert get_calib_prod_id() == prod_id


def test_date_in_yymmdd():
from osa.utils.utils import date_in_yymmdd

assert date_in_yymmdd("20200113") == "20_01_13"


def test_date_to_dir():
from osa.utils.utils import date_to_dir

Expand Down
22 changes: 0 additions & 22 deletions osa/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"date_to_iso",
"is_day_closed",
"get_prod_id",
"date_in_yymmdd",
"night_finished_flag",
"is_defined",
"create_lock",
Expand Down Expand Up @@ -213,27 +212,6 @@ def is_day_closed() -> bool:
return flag_file.exists()


def date_in_yymmdd(date_string):
"""
Convert date string YYYYMMDD into YY_MM_DD format to be used for
drive log file names.

Parameters
----------
date_string: in format YYYYMMDD

Returns
-------
yy_mm_dd: date_string in format YY_MM_DD

"""
date = list(date_string)
year = "".join(date[2:4])
month = "".join(date[4:6])
day = "".join(date[6:8])
return f"{year}_{month}_{day}"


def stringify(args):
"""Join a list of arguments in a string."""
return " ".join(map(str, args))
Expand Down
14 changes: 6 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ classifiers =
[options]
packages = find:
setup_requires = setuptools_scm
python_requires = >=3.8
python_requires = >=3.9
install_requires =
astropy~=4.2
lstchain~=0.9.13
ctapipe~=0.12.0
matplotlib~=3.5
numpy<1.22.0a0
astropy~=5.0
lstchain~=0.10.0
matplotlib~=3.7
numpy
pandas
pyyaml
prov
Expand All @@ -40,9 +39,8 @@ install_requires =
click
toml
pymongo
gammapy~=0.19.0
gammapy~=1.1
tenacity
protobuf~=3.20.0

zip_safe = no
include_package_data = True
Expand Down