info routine to display info about the ObsSequence#133
Conversation
|
in print(obs_seq) also want loc_mod? edit added loc mod |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #133 +/- ##
==========================================
+ Coverage 64.12% 64.85% +0.72%
==========================================
Files 5 5
Lines 1115 1138 +23
==========================================
+ Hits 715 738 +23
Misses 400 400 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
__repl__ and __str__ also fixes #92
| for r in routines: | ||
| print(f" - {r}") | ||
|
|
||
| def __repr__(self): |
There was a problem hiding this comment.
What does repr stand for? Might be obvious but I can't think of anything
There was a problem hiding this comment.
Read-Execute-Print Loop,
Believe it or not lfortran has a REPL for fortran (https://docs.lfortran.org/en/) so you can run fortran interactively (even in a Juypter notebook). Hours of fun.
str is what prints when you do print(obs_seq). So all the attributes of the object
repl is more like what you would use to recreate the object, which is the file.
| assert "2" in result # n_obs | ||
| assert "loc3d" in result # loc_mod | ||
|
|
||
| def test_info(self, obs_seq, capsys): |
There was a problem hiding this comment.
Would it be worth it to test if more stuff than this is in the return from info()? Even in an empty obs_seq, as shown in the body text of this PR, there should be the full set of data attributes and routines
There was a problem hiding this comment.
yes this is exactly what our intern Ira is hitting.
Right now, totally blank.
Should be the required columns. I was thinking it would be good to have Ira do the fix and pull request for a "from scratch" obs seq.
There was a problem hiding this comment.
hang on I am mixing up two issues
The test is using
obj = obsq.ObsSequence(file=None)
which is really minimal (i.e. no info). When really it should be the minimum columns (which is what it would be cool to have Ira add).
repl and str also
fixes #92
Example:
This example is a black obs seq so boring.