From bc4149a216b590e462c2bbbeb12e800dabfbc4da Mon Sep 17 00:00:00 2001 From: Kathleen Kiker Date: Thu, 11 Sep 2025 12:00:24 -0700 Subject: [PATCH 01/13] Removing uneeded dataframes --- src/adam_assist/propagator.py | 38 ++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/src/adam_assist/propagator.py b/src/adam_assist/propagator.py index 6a99982..7e4f345 100644 --- a/src/adam_assist/propagator.py +++ b/src/adam_assist/propagator.py @@ -227,18 +227,21 @@ def _propagate_orbits_inner( orbit_id_mapping, uint_orbit_ids = hash_orbit_ids_to_uint32(particle_ids) # Add the orbits as particles to the simulation - coords_df = orbits.coordinates.to_dataframe() + # OPTIMIZED: Use direct array access instead of DataFrame conversion + coords = orbits.coordinates + position_arrays = coords.r # x, y, z columns + velocity_arrays = coords.v # vx, vy, vz columns assist.Extras(sim, ephem) - for i in range(len(coords_df)): + for i in range(len(position_arrays)): sim.add( - x=coords_df.x[i], - y=coords_df.y[i], - z=coords_df.z[i], - vx=coords_df.vx[i], - vy=coords_df.vy[i], - vz=coords_df.vz[i], + x=position_arrays[i, 0], + y=position_arrays[i, 1], + z=position_arrays[i, 2], + vx=velocity_arrays[i, 0], + vy=velocity_arrays[i, 1], + vz=velocity_arrays[i, 2], hash=uint_orbit_ids[i], ) @@ -411,18 +414,21 @@ def _detect_collisions( orbit_id_mapping, uint_orbit_ids = hash_orbit_ids_to_uint32(particle_ids) # Add the orbits as particles to the simulation - coords_df = orbits.coordinates.to_dataframe() + # OPTIMIZED: Use direct array access instead of DataFrame conversion + coords = orbits.coordinates + position_arrays = coords.r # x, y, z columns + velocity_arrays = coords.v # vx, vy, vz columns assist.Extras(sim, ephem) - for i in range(len(coords_df)): + for i in range(len(position_arrays)): sim.add( - x=coords_df.x[i], - y=coords_df.y[i], - z=coords_df.z[i], - vx=coords_df.vx[i], - vy=coords_df.vy[i], - vz=coords_df.vz[i], + x=position_arrays[i, 0], + y=position_arrays[i, 1], + z=position_arrays[i, 2], + vx=velocity_arrays[i, 0], + vy=velocity_arrays[i, 1], + vz=velocity_arrays[i, 2], hash=uint_orbit_ids[i], ) From b846e78fedcb8b80889ecc99ea8674169033685c Mon Sep 17 00:00:00 2001 From: Kathleen Kiker Date: Thu, 11 Sep 2025 14:09:33 -0700 Subject: [PATCH 02/13] adding optimized single orbit function --- src/adam_assist/propagator.py | 136 ++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/src/adam_assist/propagator.py b/src/adam_assist/propagator.py index 7e4f345..0819d69 100644 --- a/src/adam_assist/propagator.py +++ b/src/adam_assist/propagator.py @@ -155,6 +155,10 @@ def _propagate_orbits(self, orbits: OrbitType, times: TimestampType) -> OrbitTyp """ Propagate the orbits to the specified times. """ + # OPTIMIZATION: Fast path for single orbits + if len(orbits) == 1: + return self._propagate_single_orbit_optimized(orbits, times) + # The coordinate frame is the equatorial International Celestial Reference Frame (ICRF). # This is also the native coordinate system for the JPL binary files. # For units we use solar masses, astronomical units, and days. @@ -188,6 +192,138 @@ def _propagate_orbits(self, orbits: OrbitType, times: TimestampType) -> OrbitTyp return results + def _propagate_single_orbit_optimized(self, orbit: OrbitType, times: TimestampType) -> OrbitType: + """ + Optimized propagation for a single orbit, bypassing grouping overhead. + """ + # Validate assumption + if len(orbit) != 1: + raise ValueError(f"Expected exactly 1 orbit, got {len(orbit)}") + + # Transform coordinates directly without grouping + transformed_coords = transform_coordinates( + orbit.coordinates, + origin_out=OriginCodes.SOLAR_SYSTEM_BARYCENTER, + frame_out="equatorial", + ) + transformed_input_orbit_times = transformed_coords.time.rescale("tdb") + transformed_coords = transformed_coords.set_column("time", transformed_input_orbit_times) + transformed_orbit = orbit.set_column("coordinates", transformed_coords) + + return self._propagate_single_orbit_inner_optimized(transformed_orbit, times) + + def _propagate_single_orbit_inner_optimized(self, orbit: OrbitType, times: TimestampType) -> OrbitType: + """ + Inner propagation optimized for exactly one orbit. + """ + # Setup ephemeris and simulation + ephem = assist.Ephem(planets_path=de440, asteroids_path=de441_n16) + sim = rebound.Simulation() + + start_tdb_time = orbit.coordinates.time.jd().to_numpy()[0] + sim.t = start_tdb_time - ephem.jd_ref + + # Handle particle ID creation (optimized for single orbit) + is_variant = isinstance(orbit, VariantOrbits) + if is_variant: + orbit_id = str(orbit.orbit_id.to_numpy(zero_copy_only=False)[0]) + variant_id = str(orbit.variant_id.to_numpy(zero_copy_only=False)[0]) + particle_hash = uint32_hash(f"{orbit_id}\x1f{variant_id}") + else: + orbit_id = str(orbit.orbit_id.to_numpy(zero_copy_only=False)[0]) + particle_hash = uint32_hash(orbit_id) + + assist.Extras(sim, ephem) + + # Add single particle + coords = orbit.coordinates + position_arrays = coords.r + velocity_arrays = coords.v + + sim.add( + x=position_arrays[0, 0], + y=position_arrays[0, 1], + z=position_arrays[0, 2], + vx=velocity_arrays[0, 0], + vy=velocity_arrays[0, 1], + vz=velocity_arrays[0, 2], + hash=particle_hash, + ) + + # Set integrator parameters + sim.dt = self.initial_dt + sim.ri_ias15.min_dt = self.min_dt + sim.ri_ias15.adaptive_mode = self.adaptive_mode + sim.ri_ias15.epsilon = self.epsilon + + # Prepare integration times (numpy only) + integrator_times = times.rescale("tdb").jd().to_numpy() + integrator_times = integrator_times - ephem.jd_ref + + # Integration loop (preallocate state array) + N = len(integrator_times) + if N == 0: + return VariantOrbits.empty() if is_variant else Orbits.empty() + + xyzvxvyvz = np.zeros((N, 6), dtype="float64") + scratch = np.zeros((1, 6), dtype="float64") + + for i in range(N): + sim.integrate(integrator_times[i]) + scratch.fill(0.0) + sim.serialize_particle_data(xyzvxvyvz=scratch) + xyzvxvyvz[i, :] = scratch[0, :] + + # Build results + jd_times = integrator_times + ephem.jd_ref + times_out = Timestamp.from_jd(jd_times, scale="tdb") + origin_codes = Origin.from_kwargs( + code=pa.repeat("SOLAR_SYSTEM_BARYCENTER", xyzvxvyvz.shape[0]) + ) + + if is_variant: + orbit_ids_out = [orbit_id] * N + variant_ids_out = [variant_id] * N + object_id_out = np.tile(orbit.object_id.to_numpy(zero_copy_only=False), N) + + return VariantOrbits.from_kwargs( + orbit_id=orbit_ids_out, + variant_id=variant_ids_out, + object_id=object_id_out, + weights=orbit.weights, + weights_cov=orbit.weights_cov, + coordinates=CartesianCoordinates.from_kwargs( + x=xyzvxvyvz[:, 0], + y=xyzvxvyvz[:, 1], + z=xyzvxvyvz[:, 2], + vx=xyzvxvyvz[:, 3], + vy=xyzvxvyvz[:, 4], + vz=xyzvxvyvz[:, 5], + time=times_out, + origin=origin_codes, + frame="equatorial", + ), + ) + else: + orbit_ids_out = [orbit_id] * N + object_id_out = np.tile(orbit.object_id.to_numpy(zero_copy_only=False), N) + + return Orbits.from_kwargs( + coordinates=CartesianCoordinates.from_kwargs( + x=xyzvxvyvz[:, 0], + y=xyzvxvyvz[:, 1], + z=xyzvxvyvz[:, 2], + vx=xyzvxvyvz[:, 3], + vy=xyzvxvyvz[:, 4], + vz=xyzvxvyvz[:, 5], + time=times_out, + origin=origin_codes, + frame="equatorial", + ), + orbit_id=orbit_ids_out, + object_id=object_id_out, + ) + def _propagate_orbits_inner( self, orbits: OrbitType, times: TimestampType ) -> OrbitType: From 69a2e7ca3639e631cdc51e2d1663e8d892ec7fce Mon Sep 17 00:00:00 2001 From: Kathleen Kiker Date: Mon, 15 Sep 2025 16:00:27 -0700 Subject: [PATCH 03/13] Changing hashing to removing string splitting --- src/adam_assist/propagator.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/adam_assist/propagator.py b/src/adam_assist/propagator.py index 0819d69..ed86630 100644 --- a/src/adam_assist/propagator.py +++ b/src/adam_assist/propagator.py @@ -1,7 +1,7 @@ import hashlib import random from ctypes import c_uint32 -from typing import Any, Dict, List, Tuple, Union +from typing import Any, Dict, List, Tuple, Union, Optional import assist import numpy as np @@ -143,6 +143,7 @@ def __init__( self.adaptive_mode = adaptive_mode self.epsilon = epsilon + def __getstate__(self) -> Dict[str, Any]: state = self.__dict__.copy() state.pop("_last_simulation", None) @@ -361,6 +362,7 @@ def _propagate_orbits_inner( particle_ids = np.array(particle_ids, dtype="object") orbit_id_mapping, uint_orbit_ids = hash_orbit_ids_to_uint32(particle_ids) + hash_to_index = {uint_orbit_ids[i].value: i for i in range(len(uint_orbit_ids))} # Add the orbits as particles to the simulation # OPTIMIZED: Use direct array access instead of DataFrame conversion @@ -410,18 +412,12 @@ def _propagate_orbits_inner( step_states.append(step_xyzvxvyvz) if is_variant: - particle_ids = [orbit_id_mapping[h] for h in orbit_id_hashes] - orbit_ids, variant_ids = zip( - *[pid.split(separator) for pid in particle_ids] - ) - step_orbit_ids.append(np.asarray(orbit_ids, dtype=object)) - step_variant_ids.append(np.asarray(variant_ids, dtype=object)) + indices = np.fromiter((hash_to_index[h] for h in orbit_id_hashes), dtype=np.int64, count=sim.N) + step_orbit_ids.append(orbit_ids[indices]) + step_variant_ids.append(variant_ids[indices]) else: - step_orbit_ids.append( - np.asarray( - [orbit_id_mapping[h] for h in orbit_id_hashes], dtype=object - ) - ) + indices = np.fromiter((hash_to_index[h] for h in orbit_id_hashes), dtype=np.int64, count=sim.N) + step_orbit_ids.append(particle_ids[indices]) # Build a single result table if len(step_states) == 0: @@ -548,6 +544,7 @@ def _detect_collisions( particle_ids = np.array(particle_ids, dtype="object") orbit_id_mapping, uint_orbit_ids = hash_orbit_ids_to_uint32(particle_ids) + hash_to_index = {uint_orbit_ids[i].value: i for i in range(len(uint_orbit_ids))} # Add the orbits as particles to the simulation # OPTIMIZED: Use direct array access instead of DataFrame conversion From c4e21a7ae674cb1b8dac913d725f40a2db5fe1a6 Mon Sep 17 00:00:00 2001 From: Kathleen Kiker Date: Thu, 18 Sep 2025 10:19:49 -0700 Subject: [PATCH 04/13] github action fix --- .github/workflows/pip-build-lint-test-coverage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pip-build-lint-test-coverage.yml b/.github/workflows/pip-build-lint-test-coverage.yml index 7df15e1..861e07d 100644 --- a/.github/workflows/pip-build-lint-test-coverage.yml +++ b/.github/workflows/pip-build-lint-test-coverage.yml @@ -94,6 +94,7 @@ jobs: needs: [ test ] permissions: contents: write + pull-requests: write defaults: run: shell: bash -l {0} From d96a7bfacab4f92a08528a094d7da65ef5bb3834 Mon Sep 17 00:00:00 2001 From: Kathleen Kiker Date: Thu, 18 Sep 2025 10:20:36 -0700 Subject: [PATCH 05/13] Linting --- src/adam_assist/propagator.py | 63 +++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 25 deletions(-) diff --git a/src/adam_assist/propagator.py b/src/adam_assist/propagator.py index ed86630..888f28b 100644 --- a/src/adam_assist/propagator.py +++ b/src/adam_assist/propagator.py @@ -1,7 +1,7 @@ import hashlib import random from ctypes import c_uint32 -from typing import Any, Dict, List, Tuple, Union, Optional +from typing import Any, Dict, List, Optional, Tuple, Union import assist import numpy as np @@ -143,7 +143,6 @@ def __init__( self.adaptive_mode = adaptive_mode self.epsilon = epsilon - def __getstate__(self) -> Dict[str, Any]: state = self.__dict__.copy() state.pop("_last_simulation", None) @@ -159,7 +158,7 @@ def _propagate_orbits(self, orbits: OrbitType, times: TimestampType) -> OrbitTyp # OPTIMIZATION: Fast path for single orbits if len(orbits) == 1: return self._propagate_single_orbit_optimized(orbits, times) - + # The coordinate frame is the equatorial International Celestial Reference Frame (ICRF). # This is also the native coordinate system for the JPL binary files. # For units we use solar masses, astronomical units, and days. @@ -193,14 +192,16 @@ def _propagate_orbits(self, orbits: OrbitType, times: TimestampType) -> OrbitTyp return results - def _propagate_single_orbit_optimized(self, orbit: OrbitType, times: TimestampType) -> OrbitType: + def _propagate_single_orbit_optimized( + self, orbit: OrbitType, times: TimestampType + ) -> OrbitType: """ Optimized propagation for a single orbit, bypassing grouping overhead. """ # Validate assumption if len(orbit) != 1: raise ValueError(f"Expected exactly 1 orbit, got {len(orbit)}") - + # Transform coordinates directly without grouping transformed_coords = transform_coordinates( orbit.coordinates, @@ -208,22 +209,26 @@ def _propagate_single_orbit_optimized(self, orbit: OrbitType, times: TimestampTy frame_out="equatorial", ) transformed_input_orbit_times = transformed_coords.time.rescale("tdb") - transformed_coords = transformed_coords.set_column("time", transformed_input_orbit_times) + transformed_coords = transformed_coords.set_column( + "time", transformed_input_orbit_times + ) transformed_orbit = orbit.set_column("coordinates", transformed_coords) - + return self._propagate_single_orbit_inner_optimized(transformed_orbit, times) - def _propagate_single_orbit_inner_optimized(self, orbit: OrbitType, times: TimestampType) -> OrbitType: + def _propagate_single_orbit_inner_optimized( + self, orbit: OrbitType, times: TimestampType + ) -> OrbitType: """ Inner propagation optimized for exactly one orbit. """ # Setup ephemeris and simulation ephem = assist.Ephem(planets_path=de440, asteroids_path=de441_n16) sim = rebound.Simulation() - + start_tdb_time = orbit.coordinates.time.jd().to_numpy()[0] sim.t = start_tdb_time - ephem.jd_ref - + # Handle particle ID creation (optimized for single orbit) is_variant = isinstance(orbit, VariantOrbits) if is_variant: @@ -233,60 +238,60 @@ def _propagate_single_orbit_inner_optimized(self, orbit: OrbitType, times: Times else: orbit_id = str(orbit.orbit_id.to_numpy(zero_copy_only=False)[0]) particle_hash = uint32_hash(orbit_id) - + assist.Extras(sim, ephem) - + # Add single particle coords = orbit.coordinates position_arrays = coords.r velocity_arrays = coords.v - + sim.add( x=position_arrays[0, 0], - y=position_arrays[0, 1], + y=position_arrays[0, 1], z=position_arrays[0, 2], vx=velocity_arrays[0, 0], vy=velocity_arrays[0, 1], vz=velocity_arrays[0, 2], hash=particle_hash, ) - + # Set integrator parameters sim.dt = self.initial_dt sim.ri_ias15.min_dt = self.min_dt sim.ri_ias15.adaptive_mode = self.adaptive_mode sim.ri_ias15.epsilon = self.epsilon - + # Prepare integration times (numpy only) integrator_times = times.rescale("tdb").jd().to_numpy() integrator_times = integrator_times - ephem.jd_ref - + # Integration loop (preallocate state array) N = len(integrator_times) if N == 0: return VariantOrbits.empty() if is_variant else Orbits.empty() - + xyzvxvyvz = np.zeros((N, 6), dtype="float64") scratch = np.zeros((1, 6), dtype="float64") - + for i in range(N): sim.integrate(integrator_times[i]) scratch.fill(0.0) sim.serialize_particle_data(xyzvxvyvz=scratch) xyzvxvyvz[i, :] = scratch[0, :] - + # Build results jd_times = integrator_times + ephem.jd_ref times_out = Timestamp.from_jd(jd_times, scale="tdb") origin_codes = Origin.from_kwargs( code=pa.repeat("SOLAR_SYSTEM_BARYCENTER", xyzvxvyvz.shape[0]) ) - + if is_variant: orbit_ids_out = [orbit_id] * N variant_ids_out = [variant_id] * N object_id_out = np.tile(orbit.object_id.to_numpy(zero_copy_only=False), N) - + return VariantOrbits.from_kwargs( orbit_id=orbit_ids_out, variant_id=variant_ids_out, @@ -308,7 +313,7 @@ def _propagate_single_orbit_inner_optimized(self, orbit: OrbitType, times: Times else: orbit_ids_out = [orbit_id] * N object_id_out = np.tile(orbit.object_id.to_numpy(zero_copy_only=False), N) - + return Orbits.from_kwargs( coordinates=CartesianCoordinates.from_kwargs( x=xyzvxvyvz[:, 0], @@ -412,11 +417,19 @@ def _propagate_orbits_inner( step_states.append(step_xyzvxvyvz) if is_variant: - indices = np.fromiter((hash_to_index[h] for h in orbit_id_hashes), dtype=np.int64, count=sim.N) + indices = np.fromiter( + (hash_to_index[h] for h in orbit_id_hashes), + dtype=np.int64, + count=sim.N, + ) step_orbit_ids.append(orbit_ids[indices]) step_variant_ids.append(variant_ids[indices]) else: - indices = np.fromiter((hash_to_index[h] for h in orbit_id_hashes), dtype=np.int64, count=sim.N) + indices = np.fromiter( + (hash_to_index[h] for h in orbit_id_hashes), + dtype=np.int64, + count=sim.N, + ) step_orbit_ids.append(particle_ids[indices]) # Build a single result table From 25fc93573355e58a31993d8231a4dd52ff4d4dfc Mon Sep 17 00:00:00 2001 From: Kathleen Kiker <72056544+KatKiker@users.noreply.github.com> Date: Thu, 18 Sep 2025 11:39:13 -0700 Subject: [PATCH 06/13] Update pip-build-lint-test-coverage.yml --- .github/workflows/pip-build-lint-test-coverage.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pip-build-lint-test-coverage.yml b/.github/workflows/pip-build-lint-test-coverage.yml index 861e07d..6d3ec9c 100644 --- a/.github/workflows/pip-build-lint-test-coverage.yml +++ b/.github/workflows/pip-build-lint-test-coverage.yml @@ -9,6 +9,7 @@ on: permissions: contents: read + pull-requests: write concurrency: group: ci-${{ github.ref }} @@ -38,7 +39,7 @@ jobs: with: python-version: '3.12' - name: Install dev dependencies - run: pdm install -G dev + run: pdm install -G dev --no-isolation - name: Lint run: pdm run lint - name: Typecheck @@ -70,7 +71,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install dev dependencies - run: pdm install -G dev + run: pdm install -G dev --no-isolation - name: Run tests (no coverage) if: matrix.python-version != '3.12' run: pdm run test @@ -116,7 +117,7 @@ jobs: with: python-version: '3.12' - name: Install dev dependencies - run: pdm install -G dev + run: pdm install -G dev --no-isolation - name: Run benchmarks run: pdm run benchmark --benchmark-json bench.json - name: Upload benchmark artifact @@ -147,3 +148,9 @@ jobs: fail-threshold: '200%' alert-threshold: '150%' auto-push: false + output-file-path: bench.json + github-token: ${{ secrets.GITHUB_TOKEN }} + comment-always: true + fail-threshold: '200%' + alert-threshold: '150%' + auto-push: false From e96628fa1444e21bf6b6afb49e91c20d548477f1 Mon Sep 17 00:00:00 2001 From: Kathleen Kiker Date: Thu, 18 Sep 2025 13:12:41 -0700 Subject: [PATCH 07/13] updates --- .github/workflows/pip-build-lint-test-coverage.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pip-build-lint-test-coverage.yml b/.github/workflows/pip-build-lint-test-coverage.yml index 861e07d..971e9a4 100644 --- a/.github/workflows/pip-build-lint-test-coverage.yml +++ b/.github/workflows/pip-build-lint-test-coverage.yml @@ -9,6 +9,7 @@ on: permissions: contents: read + pull-requests: read concurrency: group: ci-${{ github.ref }} @@ -38,7 +39,7 @@ jobs: with: python-version: '3.12' - name: Install dev dependencies - run: pdm install -G dev + run: pdm install -G dev --no-isolation - name: Lint run: pdm run lint - name: Typecheck @@ -70,7 +71,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install dev dependencies - run: pdm install -G dev + run: pdm install -G dev --no-isolation - name: Run tests (no coverage) if: matrix.python-version != '3.12' run: pdm run test @@ -116,7 +117,7 @@ jobs: with: python-version: '3.12' - name: Install dev dependencies - run: pdm install -G dev + run: pdm install -G dev --no-isolation - name: Run benchmarks run: pdm run benchmark --benchmark-json bench.json - name: Upload benchmark artifact From 6932c872b242ad864169bd29a07119684c8ff43b Mon Sep 17 00:00:00 2001 From: Kathleen Kiker Date: Thu, 18 Sep 2025 13:20:05 -0700 Subject: [PATCH 08/13] updates --- .github/workflows/pip-build-lint-test-coverage.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/pip-build-lint-test-coverage.yml b/.github/workflows/pip-build-lint-test-coverage.yml index e5894bd..971e9a4 100644 --- a/.github/workflows/pip-build-lint-test-coverage.yml +++ b/.github/workflows/pip-build-lint-test-coverage.yml @@ -148,9 +148,3 @@ jobs: fail-threshold: '200%' alert-threshold: '150%' auto-push: false - output-file-path: bench.json - github-token: ${{ secrets.GITHUB_TOKEN }} - comment-always: true - fail-threshold: '200%' - alert-threshold: '150%' - auto-push: false From a511c01e72bb20dc130766776f624fa228d45398 Mon Sep 17 00:00:00 2001 From: Kathleen Kiker Date: Fri, 19 Sep 2025 10:56:22 -0700 Subject: [PATCH 09/13] Fixing timezonefinder issue --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index f956745..9070f38 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,6 +28,7 @@ dependencies = [ "ray", "spiceypy>=6.0.0", "rebound>=4.4.10", + "timezonefinder==8.0.0", ] [build-system] From 4a12a46922401b07204ef0d9cb7d42e039b6151e Mon Sep 17 00:00:00 2001 From: Kathleen Kiker <72056544+KatKiker@users.noreply.github.com> Date: Fri, 19 Sep 2025 11:50:37 -0700 Subject: [PATCH 10/13] Update pip-build-lint-test-coverage.yml --- .github/workflows/pip-build-lint-test-coverage.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pip-build-lint-test-coverage.yml b/.github/workflows/pip-build-lint-test-coverage.yml index 971e9a4..c643cf5 100644 --- a/.github/workflows/pip-build-lint-test-coverage.yml +++ b/.github/workflows/pip-build-lint-test-coverage.yml @@ -38,6 +38,8 @@ jobs: uses: pdm-project/setup-pdm@v4 with: python-version: '3.12' + - name: Ensure setuptools and wheel + run: pip install --upgrade pip setuptools wheel - name: Install dev dependencies run: pdm install -G dev --no-isolation - name: Lint From 33b639093e65343a80f3bb55dcece752a1c93068 Mon Sep 17 00:00:00 2001 From: Kathleen Kiker Date: Fri, 19 Sep 2025 12:32:32 -0700 Subject: [PATCH 11/13] Trying to fix CI --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 9070f38..1a22367 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -96,3 +96,6 @@ profile = "black" [tool.mypy] ignore_missing_imports = true +[build-system] +requires = ["setuptools>=61", "wheel"] +build-backend = "setuptools.build_meta" From 705a30f95006db9a141951db60a5d654b67f37ae Mon Sep 17 00:00:00 2001 From: Alec Koumjian Date: Mon, 22 Sep 2025 12:48:14 -0400 Subject: [PATCH 12/13] start debug --- .github/workflows/pip-build-lint-test-coverage.yml | 8 +++----- pyproject.toml | 3 --- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pip-build-lint-test-coverage.yml b/.github/workflows/pip-build-lint-test-coverage.yml index c643cf5..352cda0 100644 --- a/.github/workflows/pip-build-lint-test-coverage.yml +++ b/.github/workflows/pip-build-lint-test-coverage.yml @@ -38,10 +38,8 @@ jobs: uses: pdm-project/setup-pdm@v4 with: python-version: '3.12' - - name: Ensure setuptools and wheel - run: pip install --upgrade pip setuptools wheel - name: Install dev dependencies - run: pdm install -G dev --no-isolation + run: pdm install -G dev - name: Lint run: pdm run lint - name: Typecheck @@ -73,7 +71,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install dev dependencies - run: pdm install -G dev --no-isolation + run: pdm install -G dev - name: Run tests (no coverage) if: matrix.python-version != '3.12' run: pdm run test @@ -119,7 +117,7 @@ jobs: with: python-version: '3.12' - name: Install dev dependencies - run: pdm install -G dev --no-isolation + run: pdm install -G dev - name: Run benchmarks run: pdm run benchmark --benchmark-json bench.json - name: Upload benchmark artifact diff --git a/pyproject.toml b/pyproject.toml index 1a22367..9070f38 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -96,6 +96,3 @@ profile = "black" [tool.mypy] ignore_missing_imports = true -[build-system] -requires = ["setuptools>=61", "wheel"] -build-backend = "setuptools.build_meta" From f9eab21e21ff7626cc8d1354e3a25d405257d785 Mon Sep 17 00:00:00 2001 From: Alec Koumjian Date: Mon, 22 Sep 2025 12:56:15 -0400 Subject: [PATCH 13/13] fix linting --- src/adam_assist/propagator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adam_assist/propagator.py b/src/adam_assist/propagator.py index 888f28b..6b7e9cf 100644 --- a/src/adam_assist/propagator.py +++ b/src/adam_assist/propagator.py @@ -1,7 +1,7 @@ import hashlib import random from ctypes import c_uint32 -from typing import Any, Dict, List, Optional, Tuple, Union +from typing import Any, Dict, List, Tuple, Union import assist import numpy as np @@ -557,7 +557,7 @@ def _detect_collisions( particle_ids = np.array(particle_ids, dtype="object") orbit_id_mapping, uint_orbit_ids = hash_orbit_ids_to_uint32(particle_ids) - hash_to_index = {uint_orbit_ids[i].value: i for i in range(len(uint_orbit_ids))} + {uint_orbit_ids[i].value: i for i in range(len(uint_orbit_ids))} # Add the orbits as particles to the simulation # OPTIMIZED: Use direct array access instead of DataFrame conversion