# VisitInfo repr() and str() should print a useful summary of contents

XMLWordPrintable

#### Details

• Type: Bug
• Status: Done
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:
• Story Points:
2
• Epic Link:
• Sprint:
Alert Production F17 - 11
• Team:
Alert Production

#### Description

The new VisitInfo object is a bit opaque from within Python: you can look at the individual components via e.g. visitInfo.darkTime and visitInfo.boresightAirmass, but print(visitInfo) is not helpful. it would be extremely useful for str() and repr() to print either the whole contents of the VisitInfo (it's not that much information), or for str() to print a useful summary and repr() the whole thing.

#### Activity

Hide
John Parejko added a comment -

There's a good way to implement this in pybind11, so we should think about doing so once pybind11 is fully implemented. We could add a some tests at the same time!

Show
John Parejko added a comment - There's a good way to implement this in pybind11, so we should think about doing so once pybind11 is fully implemented. We could add a some tests at the same time!
Hide
John Parejko added a comment -

I want something like this for debugging jointcal anyway, so I'm just going to take the time to do it right, instead of sticking cout statements in random places.

Show
John Parejko added a comment - I want something like this for debugging jointcal anyway, so I'm just going to take the time to do it right, instead of sticking cout statements in random places.
Hide
John Parejko added a comment -

Russell Owen; thanks for reviewing this. It's short and sweet, and will definitely help me debug jointcal.

Example output:

 VisitInfo(exposureId=10313423darkTime=11.02date=2037-09-20T02:24:00.000000000UT1=12345.1ERA=0.787143 radboresightRaDec=IcrsCoord(23.1000000, 73.2000000)boresightAzAlt=Coord(134.5000000, 33.3000000, 2000.00)boresightAirmass=1.73boresightRotAngle=1.27758 radrotType=1observatory=22.2W, 11.1N 0.333weather=Weather(1.1, 2.2, 34.5)) 

Show
John Parejko added a comment - Russell Owen ; thanks for reviewing this. It's short and sweet, and will definitely help me debug jointcal. Example output: VisitInfo(exposureId=10313423darkTime=11.02date=2037-09-20T02:24:00.000000000UT1=12345.1ERA=0.787143 radboresightRaDec=IcrsCoord(23.1000000, 73.2000000)boresightAzAlt=Coord(134.5000000, 33.3000000, 2000.00)boresightAirmass=1.73boresightRotAngle=1.27758 radrotType=1observatory=22.2W, 11.1N 0.333weather=Weather(1.1, 2.2, 34.5))
Hide
John Parejko added a comment -
Show
John Parejko added a comment - Jenkins run: https://ci.lsst.codes/job/stack-os-matrix/26963/
Hide
Russell Owen added a comment -

Looks good. Thanks for the useful change. A few minor optional suggestions on github.

Show
Russell Owen added a comment - Looks good. Thanks for the useful change. A few minor optional suggestions on github.
Hide
John Parejko added a comment -

Thanks for the quick review. I fixed both your comments. Jenkins passed.

Merged and Done.

Show
John Parejko added a comment - Thanks for the quick review. I fixed both your comments. Jenkins passed. Merged and Done.

#### People

Assignee:
John Parejko
Reporter:
John Parejko
Reviewers:
Russell Owen
Watchers:
Jim Bosch, John Parejko, John Swinbank, Russell Owen, Simon Krughoff
Votes:
0 Vote for this issue
Watchers:
5 Start watching this issue

#### Dates

Created:
Updated:
Resolved:

#### CI Builds

No builds found.