Skip to content

Conversation

acse-ej321
Copy link
Collaborator

@acse-ej321 acse-ej321 commented Jul 4, 2025

Update to build scripts. Key changes:

  • grouped common code -as an interim step towards a class structure:
    • created consistent functions for common code blocks
    • moved common functions helper file - as an interim step towards a class structure
  • added missing variables used by UM2N modules
  • updated naming for Movement calls
  • switched from pandas to csv for simple log outputs

@acse-ej321 acse-ej321 self-assigned this Jul 4, 2025
Copy link
Member

@jwallwork23 jwallwork23 left a comment

Choose a reason for hiding this comment

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

I haven't gone through all the changes yet because I feel the job of reviewing will be a lot easier if you could make the following modifications:

  • Remove all commented-out code.
  • Drop mentions of your username in comments.
  • Put common code from the large numbers of lines added to the script/build*.py scripts into a common location and import them. e.g., can't output_csv be reused?

Comment on lines 272 to 276
# self.jacob_det = jacobian_det
# self.jacob_det = fd.project(
# jacobian_det, fd.FunctionSpace(self.mesh, "CG", 1)
# ) # ej321 - not needed?
# self.jacob = jacobian # ej321 - this is copied from mesh_generator.py
Copy link
Member

Choose a reason for hiding this comment

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

Please avoid commented out code - it makes diffs very hard to read. Also, old versions can always be deduced from the revision history.

type=str,
default="full",
help="scheme used to generate the dataset (pad/full))",
"--boundary_scheme", type=str, default="full", help="Boundary scheme (pad/full)"
Copy link
Member

Choose a reason for hiding this comment

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

Why did you change this? I feel like the proposed help message is less helpful?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I moved the existing comment to the help string for clarity and to avoid duplication.

@acse-ej321 acse-ej321 requested a review from jwallwork23 July 7, 2025 08:03
Copy link
Member

@jwallwork23 jwallwork23 left a comment

Choose a reason for hiding this comment

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

It's difficult to review this PR because there's such a large number of lines changed and I'm not sufficiently familiar with them. Would it be possible to run some of the scripts as part of the CI testing framework? That way, we can at least be confident that they run without crashing.

"swirl_params": self.swirl_params,
"t": self.t, # time step when solving burgers eq.
"idx": self.idx, # index number for picking params for burgers tracer. # noqa
"u": self.feature["uh"] if "uh" in self.feature else None,
Copy link
Member

Choose a reason for hiding this comment

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

This is equivalent to the following. If you could replicate this for the others, that'd be great.

Suggested change
"u": self.feature["uh"] if "uh" in self.feature else None,
"u": self.feature.get("uh"),

Comment on lines +332 to +333
# i = 0
# while i < n_samples:
Copy link
Member

Choose a reason for hiding this comment

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

Remove outdated comments here and elsewhere.

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.

2 participants