Skip to content

Commit

Permalink
Merge numpy_v2_2 into logger_widget_panel (squashed)
Browse files Browse the repository at this point in the history
  • Loading branch information
atharva-2001 committed Jan 17, 2025
1 parent e41364e commit 7a37553
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
5 changes: 3 additions & 2 deletions .github/actions/setup_lfs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ inputs:
runs:
using: "composite"
steps:
- name: Clone tardis-sn/tardis-regression-data
- name: Clone atharva-2001/tardis-regression-data
uses: actions/checkout@v4
with:
repository: ${{ inputs.regression-data-repo }}
repository: atharva-2001/tardis-regression-data
path: tardis-regression-data
ref: numpy_v2_2

- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
Expand Down
1 change: 0 additions & 1 deletion conda-linux-64.lock
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ https://conda.anaconda.org/conda-forge/noarch/babel-2.14.0-pyhd8ed1ab_0.conda#96
https://conda.anaconda.org/conda-forge/noarch/beautifulsoup4-4.12.3-pyha770c72_1.conda#d48f7e9fdec44baf6d1da416fe402b04
https://conda.anaconda.org/conda-forge/noarch/bleach-6.1.0-pyhd8ed1ab_0.conda#0ed9d7c0e9afa7c025807a9a8136ea3e
https://conda.anaconda.org/conda-forge/noarch/cached-property-1.5.2-hd8ed1ab_1.tar.bz2#9b347a7ec10940d3f7941ff6c460b551
https://conda.anaconda.org/conda-forge/linux-64/cairo-1.18.0-h3faef2a_0.conda#f907bb958910dc404647326ca80c263e
https://conda.anaconda.org/conda-forge/linux-64/cffi-1.16.0-py312hf06ca03_0.conda#56b0ca764ce23cc54f3f7e2a7b970f6d
https://conda.anaconda.org/conda-forge/noarch/comm-0.2.2-pyhd8ed1ab_1.conda#74673132601ec2b7fc592755605f4c1b
https://conda.anaconda.org/conda-forge/noarch/commonmark-0.9.1-py_0.tar.bz2#6aa0173c14befcd577ded130cf6f22f5
Expand Down
7 changes: 5 additions & 2 deletions tardis/io/atom_data/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,11 @@ def prepare_lines(self):
self.selected_atomic_numbers, level="atomic_number"
)
]

self.lines = self.lines.sort_values(by="wavelength")
# see https://github.com/numpy/numpy/issues/27725#issuecomment-2465471648
# with kind="stable" the returned array will maintain the relative order of a values which compare as equal.
# this is important especially after numpy v2 release
# https://numpy.org/doc/stable/release/2.0.0-notes.html#minor-changes-in-behavior-of-sorting-functions
self.lines = self.lines.sort_values(by=["wavelength", "line_id"], kind="stable")

def prepare_line_level_indexes(self):
levels_index = pd.Series(
Expand Down
4 changes: 2 additions & 2 deletions tardis/io/model/readers/generic_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def read_simple_ascii_density(
fname,
skip_header=1,
names=("index", "velocity", "density"),
dtype=None,
encoding=None,
dtype=[('index', 'i8'), ('velocity', 'f8'), ('density', 'f8')],
encoding='utf-8',
)
velocity = (data["velocity"] * u.km / u.s).to("cm/s")
mean_density = (data["density"] * u.Unit("g/cm^3"))[1:]
Expand Down
5 changes: 2 additions & 3 deletions tardis/transport/montecarlo/tests/test_rpacket_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,9 @@ def test_rpacket_tracker_properties(expected, obtained, request):
def test_boundary_interactions(rpacket_tracker, regression_data):
no_of_packets = len(rpacket_tracker)

# Hard coding the number of columns
# Based on the largest size of boundary_interaction array (60)
max_boundary_interaction_size = max([tracker.boundary_interaction.size for tracker in rpacket_tracker])
obtained_boundary_interaction = np.full(
(no_of_packets, 64),
(no_of_packets, max_boundary_interaction_size),
[-1],
dtype=rpacket_tracker[0].boundary_interaction.dtype,
)
Expand Down

0 comments on commit 7a37553

Please sign in to comment.