Skip to content
Open
Show file tree
Hide file tree
Changes from 18 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
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ jobs:
- cp3*-manylinux_x86_64
# MacOS wheels
- cp3*-macosx_x86_64
# Until we have arm64 runners, we can't automatically test arm64 wheels
- cp3*-macosx_arm64
# Windows wheels
- cp3*-win_amd64
sdist: true
test_command: python -c "from stcal.ramp_fitting.ols_cas22 import _ramp, _jump, _fit; from stcal.ramp_fitting import slope_fitter"
secrets:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
- linux: py313-cov-xdist
coverage: codecov
- macos: py313-xdist
- windows: py313-xdist
python-version: '>=3.13.5 <3.14'
test_downstream:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
Expand Down
20 changes: 18 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import numpy as np
import os
import sys

Check warning on line 3 in setup.py

View check run for this annotation

Codecov / codecov/patch

setup.py#L2-L3

Added lines #L2 - L3 were not covered by tests
from Cython.Build import cythonize
from Cython.Compiler import Options
from setuptools import Extension, setup
Expand All @@ -15,9 +17,22 @@
include_dirs = [np.get_include()]

# Setup C module macros
define_macros = [("NUMPY", "1")]
define_macros = [

Check warning on line 20 in setup.py

View check run for this annotation

Codecov / codecov/patch

setup.py#L20

Added line #L20 was not covered by tests
("NUMPY", "1"),
]

# Setup C libraries
libraries = []

Check warning on line 25 in setup.py

View check run for this annotation

Codecov / codecov/patch

setup.py#L25

Added line #L25 was not covered by tests

if sys.platform.startswith("win"):
define_macros.append(("PSAPI_VERSION", "1"))
libraries.append("psapi")

Check warning on line 29 in setup.py

View check run for this annotation

Codecov / codecov/patch

setup.py#L27-L29

Added lines #L27 - L29 were not covered by tests

debug_logdir= os.environ.get("DEBUG_LOGDIR")
if debug_logdir:
define_macros.append(("DEBUG_LOGDIR", f"\"{debug_logdir}\""))

Check warning on line 33 in setup.py

View check run for this annotation

Codecov / codecov/patch

setup.py#L31-L33

Added lines #L31 - L33 were not covered by tests

# importing these extension modules is tested in `.github/workflows/build.yml`;
# importing these extension modules is tested in `.github/workflows/build.yml`;
# when adding new modules here, make sure to add them to the `test_command` entry there
extensions = [
Extension(
Expand All @@ -43,6 +58,7 @@
["src/stcal/ramp_fitting/src/slope_fitter.c"],
include_dirs=include_dirs,
define_macros=define_macros,
libraries=libraries,
),
]

Expand Down
10 changes: 8 additions & 2 deletions src/stcal/outlier_detection/median.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import logging
import tempfile
import warnings
import sys
from pathlib import Path
from typing import Any

Expand Down Expand Up @@ -184,8 +185,13 @@
msg = f"Invalid slice shape {slice_shape}. Only 2-D arrays are supported."
raise ValueError(msg)
self._filename = Path(filename)
with Path.open(self._filename, "wb") as f: # noqa: F841
pass
try:
with Path.open(self._filename, "wb") as f: # noqa: F841
pass
except PermissionError:
if self._filename.is_dir() and sys.platform.startswith("win"):
raise IsADirectoryError(self._filename)

Check warning on line 193 in src/stcal/outlier_detection/median.py

View check run for this annotation

Codecov / codecov/patch

src/stcal/outlier_detection/median.py#L192-L193

Added lines #L192 - L193 were not covered by tests

self._slice_shape = slice_shape
self._dtype = np.dtype(dtype)
self._append_count = 0
Expand Down
Loading
Loading