-
Notifications
You must be signed in to change notification settings - Fork 17
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
Better __repr__ or .info() method #181
Comments
Suggestion:
Three other things:
|
Completely agree that we need a better If implementing
Another thing we can add in the future is a |
I agree with the ouput format proposed by @leouieda . The only "problem" I see is that formatting the reference in a nice way can be tricky as we don't know where is what. Option can be
For point 2: reference = {
"author": "Hofmann-Wellenhof, B., & Moritz, H.",
"title": "Physical Geodesy",
"edition": "2nd, corr. ed. 2006",
"publisher": "Springer",
"year": 2006,
"location": "Wien; New York"
} or using a small class Reference(
author="Hofmann-Wellenhof, B., & Moritz, H.",
title="Physical Geodesy",
edition="2nd, corr. ed. 2006",
publisher="Springer",
year=2006,
location="Wien; New York"
) |
Another problem is that the new ellipsoids can have up to 4 references (one for each of the input parameters). One possible solution would be not to print the reference string at all for |
What do you think of this layout for
The "Source" section is a little long when there are mutliple references, but I don't think that we can do anything about it. The only option would be to remove it altogether, and give a not useful partial reference. Also, for the bi-axial ellipsoid, we could also provide the semiminor axis, which is derived from the flattening and semimajor axis. |
I like the idea of @VascoSch92 to have a dataclass for each reference. This way we can choose to only output the minimal information about each reference like authors' names, year and doi. Alternatively, the For example:
|
Description of the desired feature:
Printing the contents of a boule ellipsoid gives the following:
As this is a really long string, it is somewhat difficult to read if you a looking for a particular element. I propose that we provide an easier way to print the entirety of the ellipsoid contents for human readibility. This could either be by explicitly defining
__repr__
for each ellispoid class or by providing a simple method such asEllipsoid.info()
. The output would look something like this:If desired, we could also append the units, but if we did this, we should probably define the units for each attribute in the class.
Are you willing to help implement and maintain this feature?
After we decide on how to do this, the changes would be trivial to make...
The text was updated successfully, but these errors were encountered: