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

ENH: customising reps for nonTable classes #478

Merged
merged 3 commits into from
Sep 11, 2023

Conversation

bsipocz
Copy link
Member

@bsipocz bsipocz commented Aug 9, 2023

This is a draft for solutions for #476

If you all like this approach, I would do this systematically for all the __repr__s we have elsewhere in the library.

See the equivalent for VOTable in astropy: astropy/astropy#14702

@bsipocz bsipocz added this to the v1.5 milestone Aug 9, 2023
@codecov
Copy link

codecov bot commented Aug 9, 2023

Codecov Report

Merging #478 (6094999) into main (2092174) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #478   +/-   ##
=======================================
  Coverage   80.00%   80.00%           
=======================================
  Files          52       52           
  Lines        6035     6035           
=======================================
  Hits         4828     4828           
  Misses       1207     1207           
Files Changed Coverage Δ
pyvo/dal/query.py 84.81% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@tomdonaldson
Copy link
Contributor

I like the simplicity of this approach and the output is much improved. I think it makes sense to systematically apply across the board. That doesn't preclude us from future customizations of certain __repr__ s if the type would benefit from additional or different information.

@bsipocz
Copy link
Member Author

bsipocz commented Aug 22, 2023

OK, actually I think this is the only instance of the confusing repr, everywhere else it already reflects the classname or at least the name of one of its base classes.

The one more improvement we may consider is subclasses of DALResults all say a DALResultsTable in their __repr__, ultimately we may want to distinguish between them?

@bsipocz bsipocz marked this pull request as ready for review August 22, 2023 23:46
@bsipocz bsipocz merged commit 75bcb73 into astropy:main Sep 11, 2023
12 checks passed
@bsipocz bsipocz deleted the ENH_nonTable_reprs branch October 20, 2023 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants