OpenFreeEnergy / gufe

grand unified free energy by OpenFE
https://gufe.readthedocs.io
MIT License
28 stars 8 forks source link

Improve readability of the settings when printed out #263

Closed IAlibay closed 6 months ago

IAlibay commented 9 months ago

From a call today with @hannahbaumann - it feels like the way in which we look at settings is too messy to be accessible to users. Is there a way we could improve the __repr__ or something like that to make it prettier?

richardjgowers commented 9 months ago

I think __repr__ is meant to be a single line string, so probably not with that. __str__ would make print(str(settings)) better. Are you also thinking about the file representation too?

IAlibay commented 9 months ago

I think just changing the print behaviour would be fine - it's mostly a case of having a nice way to look at the output.

maybe just make __str__ return settings.dict()? (at least pprint on that looks good)

richardjgowers commented 9 months ago

yeah __str__ being pprint(settings.dict()) seems very useful. If we're being fancy we could also make that the jupyter hook whatever that's called