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

WIP physical params file. #7

Merged
merged 40 commits into from
Nov 18, 2024
Merged

WIP physical params file. #7

merged 40 commits into from
Nov 18, 2024

Conversation

KatKiker
Copy link
Contributor

@KatKiker KatKiker commented Nov 7, 2024

May contain some bugs, old unit tests need to be updated and will definitely fail.

Copy link

github-actions bot commented Nov 8, 2024

Pull Request Test Coverage Report for Build 11843911262

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 13 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+1.7%) to 94.737%

Files with Coverage Reduction New Missed Lines %
opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/adam_impact_study/sorcha_utils.py 4 86.84%
opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/adam_impact_study/impacts_study.py 9 89.9%
Totals Coverage Status
Change from base Build 11259628166: 1.7%
Covered Lines: 324
Relevant Lines: 342

💛 - Coveralls

Copy link
Member

@moeyensj moeyensj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few minor comments and possible suggestions on formatting. Getting excited to see this all running!

src/adam_impact_study/physical_params.py Show resolved Hide resolved
src/adam_impact_study/physical_params.py Outdated Show resolved Hide resolved
src/adam_impact_study/physical_params.py Outdated Show resolved Hide resolved
src/adam_impact_study/physical_params.py Outdated Show resolved Hide resolved
src/adam_impact_study/physical_params.py Outdated Show resolved Hide resolved
src/adam_impact_study/physical_params.py Show resolved Hide resolved
KatKiker and others added 13 commits November 14, 2024 11:10
Testing removal of test: 

def test_for_impact_dates(impactors_file_mock):
    propagator = ASSISTPropagator()
    initial_orbit_objects = impactor_file_to_adam_orbit(impactors_file_mock)
    for obj_id in initial_orbit_objects:
        impactor_orbit_object = obj_id
        results, impacts = propagator.detect_impacts(impactor_orbit_object, 60)
        assert (
            abs(
                impactor_orbit_object.coordinates.time.add_days(30).to_numpy()[0]
                - impacts.coordinates.time.to_numpy()[0]
            )
            < 1
        )
Copy link
Contributor

@akoumjian akoumjian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, but confider saving and loading the impact configs as parquet or csv if they need to be human readable using to_[format] / from_[format] on the quivr tables.

Comment on lines +224 to +253
S_type = ImpactorConfig.from_kwargs(
config_id=[f"S_type_{run_id}"],
ast_class=["S"],
albedo_min=[config_data.get("S_albedo_min", 0.10)],
albedo_max=[config_data.get("S_albedo_max", 0.22)],
albedo_distribution=["uniform"],
percentage=[config_data.get("percent_S", 0.5)],
min_diam=[config_data.get("min_diam", 0.01)],
max_diam=[config_data.get("max_diam", 1)],
u_r=[config_data.get("u_r_S", 2.182)],
g_r=[config_data.get("g_r_S", 0.65)],
i_r=[config_data.get("i_r_S", -0.2)],
z_r=[config_data.get("z_r_S", -0.146)],
y_r=[config_data.get("y_r_S", -0.151)],
)

C_type = ImpactorConfig.from_kwargs(
config_id=[f"C_type_{run_id}"],
ast_class=["C"],
albedo_min=[config_data.get("C_albedo_min", 0.03)],
albedo_max=[config_data.get("C_albedo_max", 0.09)],
albedo_distribution=["uniform"],
percentage=[config_data.get("percent_C", 0.5)],
min_diam=[config_data.get("min_diam", 0.01)],
max_diam=[config_data.get("max_diam", 1)],
u_r=[config_data.get("u_r_C", 1.786)],
g_r=[config_data.get("g_r_C", 0.474)],
i_r=[config_data.get("i_r_C", -0.119)],
z_r=[config_data.get("z_r_C", -0.126)],
y_r=[config_data.get("y_r_C", -0.131)],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could store the config file using ImpactorConfig, either as parquet or as csv. (e.g. to_csv). CSV would allow it to be human readable, if that's important. Then you can just load it in with a single command.

@KatKiker KatKiker merged commit f796e08 into main Nov 18, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants