Skip to content

Commit

Permalink
Merge pull request #14 from B612-Asteroid-Institute/adam-fo
Browse files Browse the repository at this point in the history
Adam fo
  • Loading branch information
akoumjian authored Jan 24, 2025
2 parents 646ffca + a911c07 commit b0020f6
Show file tree
Hide file tree
Showing 15 changed files with 535 additions and 1,275 deletions.
814 changes: 270 additions & 544 deletions pdm.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ dependencies = [
"adam_assist>=0.2.0",
"ray[default]==2.39.0",
"sorcha @ git+https://github.com/B612-Asteroid-Institute/sorcha@23a3392f0145f7dbbdbb7b17687b69902716bde8",
"adam-core>=0.3.5",
"adam-core @ git+https://github.com/B612-Asteroid-Institute/adam_core@ee57577ff786c573c856d591b1e993d1649576f3",
"quivr @ git+https://github.com/B612-Asteroid-Institute/quivr@2d8ae0b40bdfb75bcceff0c73d41a52d4bffb5dc",
"adam-fo @ git+https://github.com/B612-Asteroid-Institute/adam_fo@1a900ad69577c9cf4ce2190156280e80d70f9ca1",
"ipdb>=0.13.13",
]
requires-python = "<3.13,>=3.11"
Expand Down Expand Up @@ -53,7 +54,7 @@ lint = { composite = [
fix = "ruff ./src/adam_impact_study --fix"
typecheck = "mypy --strict ./src/adam_impact_study"

test = "pytest --benchmark-disable {args}"
test = "pytest --benchmark-disable {args} -rs"
doctest = "pytest --doctest-plus --doctest-only"
benchmark = "pytest --benchmark-only"
coverage = "pytest --cov=adam_impact_study --cov-report=xml"
Expand Down
11 changes: 10 additions & 1 deletion src/adam_impact_study/analysis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
# ruff: noqa F401
from .main import summarize_impact_study_results
from .main import (
DiscoveryDates,
RealizationTimes,
WarningTimes,
compute_discovery_dates,
compute_realization_time,
compute_warning_time,
plot_ip_over_time,
summarize_impact_study_results,
)
2 changes: 1 addition & 1 deletion src/adam_impact_study/analysis/tests/test_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def test_compute_discovery_dates():
)

# Compute discovery dates
discovery_dates = compute_discovery_dates(impactor_orbits, results)
discovery_dates = compute_discovery_dates(results)

# Check we got results for all objects
assert len(discovery_dates) == 3
Expand Down
4 changes: 4 additions & 0 deletions src/adam_impact_study/cli/impact.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import pyarrow as pa
import pyarrow.compute as pc
from adam_core.time import Timestamp
from adam_fo.config import check_build_exists

from adam_impact_study.analysis.main import plot_ip_over_time
from adam_impact_study.impacts_study import run_impact_study_all
Expand All @@ -26,6 +27,9 @@ def run_impact_study(
overwrite: bool = False,
) -> None:
"""Run impact study on provided orbits."""
# Test that the build fo script has been run
check_build_exists()

# Load orbits directly from parquet
logger.info(f"Loading orbits from {orbit_file}")
impactor_orbits = ImpactorOrbits.from_parquet(orbit_file)
Expand Down
Loading

0 comments on commit b0020f6

Please sign in to comment.