Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atlas metadata print out #91

Merged
merged 6 commits into from
Oct 22, 2020
Merged

Atlas metadata print out #91

merged 6 commits into from
Oct 22, 2020

Conversation

FedeClaudi
Copy link
Contributor

Okay so I've added a __rich_console__ method to the BGAtlas class, that's what's used by rich's Console for printing objects. If users use the builtin print function than __str__ will be used instead, which prints the same but without colors.

This is what it looks like:
image

and with the normal print
image

and __repr__ returns:
image

@nickdelgrosso
Copy link
Member

Wow, looks great!

Copy link
Member

@vigji vigji left a comment

Choose a reason for hiding this comment

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

Nice, looks good to me!

The only things I would raise is that

  1. Probably we want this to go in the atlas Core class, for it to be available also for custom atlases from local data - all info should be available;
  2. Maybe it's a bit lot of "cosmetic" code to go in the main data-centric class, and could be refactored out in an utility function; but this is entirely subjective, and I'm happy to keep it this way and maybe move it later, it's a really minor change.

They're beautiful!

@FedeClaudi
Copy link
Contributor Author

Sure, I can move it to a function no problem

@FedeClaudi
Copy link
Contributor Author

aight, moved the __ methods to Core and the bulk of the rich code to a utility function

Copy link
Member

@vigji vigji left a comment

Choose a reason for hiding this comment

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

Great! Good for me to merge, thanks for this!

@FedeClaudi FedeClaudi merged commit 454c22f into master Oct 22, 2020
@adamltyson adamltyson deleted the atlas_report branch August 14, 2024 09:29
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