Skip to content

Conversation

@CB-quakemodel
Copy link
Contributor

@CB-quakemodel CB-quakemodel commented Sep 16, 2025

This PR cleans the MAN module in the following ways:

  • All python modules have been cleaned (removing unused imports, ordering imports, adding the GEM copyright to top of each file, consistent formatting and for functions with many inputs making them one input per line to make less cluttered)

  • Moving similar sets of functions into the same python modules. For example, the functions pertaining to mfds and rates have all been moved into a single module, rather than being dispersed as before.

  • Cleaning up the tests - the data for each test is now separate and clearly labelled, as before they were in mixed directories).

  • Cleaning the notebooks to be more readily usable and updating the imports to match the new MAN module structure.

  • I remove the csv_site function as it is very arbitrary (just prints a site amp function), and also the unit tests are incomplete (they are just a string which I guess was going to be the expected results of using this function, but I see no test data or unit test classes here either).

  • Better defining each set of functions. For example the functions which work on a single source typology are now stored in a folder called single_source_utils rather than just single which was a bit ambiguous. Another example is the checks directory, which is now called checking_utils and has more clearly defined python modules within it - the MFD and rates functions 2 separate modules both called mfd.py, and a module called rates.py and have been merged into a single python module given they were heavily interlinked (the new module is called mfds_and_rates.py)

@CB-quakemodel CB-quakemodel changed the title tidying MAN [WIP] tidying MAN Sep 16, 2025
@CB-quakemodel CB-quakemodel changed the title [WIP] tidying MAN tidying MAN Sep 16, 2025
@@ -1,42 +1,40 @@
# ------------------- The OpenQuake Model Building Toolkit --------------------
Copy link
Collaborator

Choose a reason for hiding this comment

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

I need to think about this change.... I don't think I'm exaggerating when I say it would break 100s of my scripts but I do understand the point changing the submodule organization

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