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

Dev #239

Merged
merged 4 commits into from
Jan 14, 2025
Merged

Dev #239

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
4 changes: 2 additions & 2 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
ls -ltrh
ls -ltrh dist
- name: Publish to Test PyPI
uses: pypa/[email protected].2
uses: pypa/[email protected].3
with:
repository-url: https://test.pypi.org/legacy/
verbose: true
Expand Down Expand Up @@ -96,5 +96,5 @@ jobs:
name: artifact
path: dist

- uses: pypa/[email protected].2
- uses: pypa/[email protected].3
if: startsWith(github.ref, 'refs/tags')
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ repos:
# args: ["--fix", "--show-fixes"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.13.0"
rev: "v1.14.1"
hooks:
- id: mypy
files: src
Expand Down
6 changes: 3 additions & 3 deletions astrophot/models/_shared_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def parametric_segment_initialize(
return
# Get the sub-image area corresponding to the model image
target_area = target[model.window]
target_dat = target_area.data.detach().cpu().numpy()
target_dat = target_area.data.detach().cpu().numpy().copy()
if target_area.has_mask:
mask = target_area.mask.detach().cpu().numpy()
target_dat[mask] = np.median(target_dat[np.logical_not(mask)])
Expand Down Expand Up @@ -477,7 +477,7 @@ def spline_segment_initialize(

profR = parameters["I(R)"].prof.detach().cpu().numpy()
target_area = target[self.window]
target_dat = target_area.data.detach().cpu().numpy()
target_dat = target_area.data.detach().cpu().numpy().copy()
if target_area.has_mask:
mask = target_area.mask.detach().cpu().numpy()
target_dat[mask] = np.median(target_dat[np.logical_not(mask)])
Expand Down Expand Up @@ -578,7 +578,7 @@ def relspline_initialize(self, target=None, parameters=None, **kwargs):
super(self.__class__, self).initialize(target=target, parameters=parameters)

target_area = target[self.window]
target_dat = target_area.data.detach().cpu().numpy()
target_dat = target_area.data.detach().cpu().numpy().copy()
if target_area.has_mask:
mask = target_area.mask.detach().cpu().numpy()
target_dat[mask] = np.median(target_dat[np.logical_not(mask)])
Expand Down
2 changes: 1 addition & 1 deletion astrophot/models/galaxy_model_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def initialize(self, target=None, parameters: Optional[Parameter_Node] = None, *
if not (parameters["PA"].value is None or parameters["q"].value is None):
return
target_area = target[self.window]
target_dat = target_area.data.detach().cpu().numpy()
target_dat = target_area.data.detach().cpu().numpy().copy()
if target_area.has_mask:
mask = target_area.mask.detach().cpu().numpy()
target_dat[mask] = np.median(target_dat[np.logical_not(mask)])
Expand Down
2 changes: 1 addition & 1 deletion astrophot/models/multi_gaussian_expansion_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def initialize(self, target=None, parameters=None, **kwargs):
super().initialize(target=target, parameters=parameters)

target_area = target[self.window]
target_dat = target_area.data.detach().cpu().numpy()
target_dat = target_area.data.detach().cpu().numpy().copy()
if target_area.has_mask:
mask = target_area.mask.detach().cpu().numpy()
target_dat[mask] = np.median(target_dat[np.logical_not(mask)])
Expand Down
2 changes: 1 addition & 1 deletion astrophot/models/point_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def initialize(self, target=None, parameters=None, **kwargs):
if parameters["flux"].value is not None:
return
target_area = target[self.window]
target_dat = target_area.data.detach().cpu().numpy()
target_dat = target_area.data.detach().cpu().numpy().copy()
with Param_Unlock(parameters["flux"]), Param_SoftLimits(parameters["flux"]):
icenter = target_area.plane_to_pixel(parameters["center"].value)
edge = np.concatenate(
Expand Down
Loading