Skip to content

Conversation

@anschaible
Copy link
Collaborator

-Fix rotation for nihao
-Fix gas metals for nihao
-Fix stellar age for nihao

@TobiBu
Copy link
Collaborator

TobiBu commented Apr 7, 2025

tests are failing with missing argument 'gamma'.

Can we fix this? then I do the review.

@TobiBu TobiBu requested a review from Copilot April 7, 2025 19:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • notebooks/nohup.out: Language not supported
Comments suppressed due to low confidence (1)

rubix/galaxy/input_handler/pynbody.py:112

  • [nitpick] Using a hardcoded index (4) for placing OxMassFrac may reduce clarity; consider defining a constant or using a named index for improved readability.
        metals[:, 4] = ox_data["OxMassFrac"]

setattr(component, "coords", coords)
setattr(component, "velocity", velocities)

return rubixdata"
Copy link

Copilot AI Apr 7, 2025

Choose a reason for hiding this comment

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

Extraneous string literal after the return statement appears to be an unintended docstring terminator. Please remove the spurious quotes to ensure proper function behavior.

Suggested change
return rubixdata"
return rubixdata

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

and this is still to be fixed, right?

vel_rot = apply_init_rotation(velocities, R)
pos_final = apply_rotation(pos_rot, alpha, beta, gamma)
vel_final = apply_rotation(vel_rot, alpha, beta, gamma)
if key == "ILlustrisTNG":
Copy link

Copilot AI Apr 7, 2025

Choose a reason for hiding this comment

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

The string 'ILlustrisTNG' appears to be a misspelling of 'IllustrisTNG'. Correct the string to ensure consistent behavior.

Suggested change
if key == "ILlustrisTNG":
if key == "IllustrisTNG":

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

changed it

Copy link
Collaborator

Choose a reason for hiding this comment

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

this file should not be in the repo.
Let's remove

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed it

@TobiBu
Copy link
Collaborator

TobiBu commented May 27, 2025

@anschaible @ufuk-cakir also we should probably clean this one up.

Copy link
Collaborator

@TobiBu TobiBu left a comment

Choose a reason for hiding this comment

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

Sorry, there is one more thing I found...

self.logger.info("Metals assigned to gas particles.")
self.logger.info("Metals shape is: %s", self.data["gas"]["metals"].shape)

self.data["stars"]["age"] = 14.14019767 * u.Gyr - self.data["stars"]["age"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we have 14.14 Gyr? shouldn't the universe be 13.8 Gyr?

Copy link
Collaborator

Choose a reason for hiding this comment

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

probably that should be connected to the cosmology we specify in the yaml file...
see here:

def age_at_z0(self) -> Float[Array, "..."]:

@ufuk-cakir ufuk-cakir self-requested a review July 1, 2025 19:46
hdr1["EXTNAME"] = "DATA"
hdr1["OBJECT"] = object_name
hdr1["BUNIT"] = "erg/(s*cm^2*A)" # flux unit per Angstrom
hdr1["BUNIT"] = "10**-20 erg/(s*cm^2*A)" # flux unit per Angstrom
Copy link
Collaborator

Choose a reason for hiding this comment

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

why this factor?

"""
logger.info("Rotating galaxy for simulation: " + config["simulation"]["name"])
# Rotate gas
if "gas" in config["data"]["args"]["particle_type"]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

this part looks like it can be refactored, but only minor comment

vel_rot = apply_init_rotation(velocities, R)
pos_final = apply_rotation(pos_rot, alpha, beta, gamma)
vel_final = apply_rotation(vel_rot, alpha, beta, gamma)
elif key == "NIHAO":
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe add comment here why we distinguish between illustris and nihao

ufuk-cakir
ufuk-cakir previously approved these changes Jul 1, 2025
Copy link
Collaborator

@ufuk-cakir ufuk-cakir left a comment

Choose a reason for hiding this comment

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

some minor comments

@anschaible anschaible dismissed ufuk-cakir’s stale review July 2, 2025 14:02

The merge-base changed after approval.

@anschaible anschaible requested review from TobiBu and ufuk-cakir July 2, 2025 14:47
@TobiBu TobiBu merged commit 75efd92 into main Jul 3, 2025
6 checks 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.

4 participants