Conversation
✅ COMPAS Build Successful!
Detailed Evolution PlotGenerated by COMPAS CI |
ilyamandel
left a comment
There was a problem hiding this comment.
I leave the review to folks who use python (@SimonStevenson ? @avigna ? ).
Consider including supported python tools in the documentation in https://compas.readthedocs.io/en/latest/pages/User%20guide/Post-processing/post-processing.html
|
Looks cool! I would suggest adding some more doctrings at the top, adding some pytests to ensure that this is maintained/doesn't break in the future. Also, how is this different from h5view? Can they be merged together? Finally, if you can add it to the setup.py entry points, its quite easy to get the auto-documentation tools to build docs like so I have some time, im happy to help with this if youd like :) |
|
As I suggested in @ilyamandel's post on Slack, I think it might be useful to add type hinting and docstring styling (similar to numpy) to bring the python code style closer to what we have for C++ files. Perhaps we can start here by just adding type hints? |
| ######################################################################## | ||
| # ## Function to print the data from a given COMPAS HDF5 group in a readable pandas template | ||
|
|
||
| def printCompasDetails(data, *seeds, mask=()): |
There was a problem hiding this comment.
Do I understand correctly that this function name might be a bit misleading? Outside the jupyter environment it would just return the data frame, not print it.
I also wonder if *seeds could be replaced for an input list, it might be more readable for large sets of seeds.
| mask = np.ones_like(allSeeds).astype(bool) | ||
| mask &= seedsMask | ||
|
|
||
| df = pd.DataFrame.from_dict({param: data[param][()][mask] for param in list(data.keys())}).set_index(seedVariableName).T |
There was a problem hiding this comment.
There are a couple of values being repeated, e.g., ('SEED' in list_of_keys) and list(data.keys())
| else: # No seed parameter, so do custom print for Run Details | ||
|
|
||
| # Get just the keys without the -Derivation suffix - those will be a second column | ||
| keys_not_derivations = [] |
There was a problem hiding this comment.
Can be swapped for a one line definition without affecting readability, e.g., keys_not_derivations = [x for x in key_list if "-Derivation" not in x] or similar

Added my own compasUtils file, which I use for lots of post-processing and testing. It was previously in
misc/unsupported_utils, so I am hoping to get it elevated to the level of the other utils.This contains two major functions that help a lot with inspecting COMPAS data.
I expect that there will be changes requested, so it is probably not yet ready to be merged in, but happy to hear feedback on how to improve / align these scripts with the other python utilities.