Skip to content

Conversation

@mabruzzo
Copy link
Collaborator

@mabruzzo mabruzzo commented Dec 4, 2025

To be reviewed after #455 is merged


This is a lightweight PR consisting of 2 commits that replaced the logic in initialize_cloudy_data.cpp for computing CoolUnit with equivalent logic that constructs an instance of InternalGrUnits and then reads the coolunit member. Essentially, this is another step towards having a single source of truth for computing code unit conversions.

Aside: I have preserved the unique value of the hydrogen mass used in these calculations so that answer tests won't drift. But, the day is quickly approaching when we will be able to have a single hydrogen mass constant used throughout the codebase.

This commit includes a few more changes than I initially wanted
This was spurred on by deprecation warnings included on macOS's
implementation of the standard library
Previously, InternalGrUnits only needed to swap between 2 values so we
used a switch of 0 or 1. But, now we have added support for a 3rd value
of the Hydrogen Mass (i.e. the value historically used to compute units
for the cloudy table). Now that we have 3 values, we define an enum.

Don't forget, this is all temporary. The time is rapidly approaching
when we will be to transition to just having a single definition for the
hydrogen mass constant.
@mabruzzo mabruzzo added the refactor internal reorganization or code simplification with no behavior changes label Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor internal reorganization or code simplification with no behavior changes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant