-
Notifications
You must be signed in to change notification settings - Fork 27
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
reorganize utils #1450
reorganize utils #1450
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely a step forward, I'd say. I've made a few comments on individual module names that I think could be better, but overall I like the names/locations.
For me, I'd stick with utils.io
and just silence the flake8 error. If you really want it not to be io
than you could maybe call it iofmts
or fileio
or just formats
.
@steven-murray I took another pass at the organization, see what you think now. I got rid of |
Once we settle on the organization I will also need to update the docs. |
@bhazelton -- I took a look through and I think things look reasonably sensible, though how the docs are going to render was one of the big outstanding questions I had. |
@mkolopanis @kartographer votes? |
I would vote fileio -- seems most descriptive of the options |
I'm okay adding an exception to shadow |
Oh, misread the above -- thought we were taking the |
Ok, I changed the I also did a fairly major update to the docs that I'd like people to take a look at. I chose to list the functions that are importable directly from |
5323fd6
to
6387d76
Compare
5faf1c6
to
bbca715
Compare
@bhazelton I think for the docs it would be cleaner just to have the |
bbca715
to
cad23ea
Compare
@steven-murray that sounds reasonable, but I have a few questions:
|
4471965
to
df673d5
Compare
cad23ea
to
ee5f918
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## prep_v3.0 #1450 +/- ##
=============================================
- Coverage 99.93% 99.75% -0.19%
=============================================
Files 42 61 +19
Lines 21238 21359 +121
=============================================
+ Hits 21224 21306 +82
- Misses 14 53 +39 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is looking really good @bhazelton! Just a few small suggestions -- I actually like the split between the "developer" and "general use" utilities, so I'd be in favor of keeping that.
ee5f918
to
6494d0b
Compare
@bhazelton I think:
And I'd be OK if the top-level functions are re-listed in their respective subpackages.
|
Well I'm about to not be helpful because I like both steven and karto's suggestions. But from a user point of view, probably best to have functions documented at exactly the level they would be called/imported from. I'm also of the mind that a
warning in front of "developer" or "private" utilities is probably worthwhile. Let's most users know to stop reading. |
Is the "simplest" path forward then to push |
Ok, so I think the remaining questions are:
|
I think I've managed to convince myself that putting them back inside |
Other docs and import cleanups
Ok, I've updated the structure and docs given this conversation. I think it's ready for another look! |
Also update lunarsky min dependency throughout
193c248
to
43fca6e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Looking good! The doctest failure looks to be a minor clean-up issue, but it looks like part of the warnings test falling over is that something is awry with the casacore installation? |
@kartographer ah, so the casacore problem makes some sense given context from here: My take is that the conda package works because Peter Williams rebuilt the numpy bindings but that the pypi package doesn't. I'll put the numpy restriction back in for the casa optional dependency. |
@kartographer Thanks, I fixed the doctest and warnings issues. There's still a codecov issue I don't understand. I can tell that the lines it's claiming are missed are actually hit when I run the tests on my machine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks @bhazelton!
Description
As suggested in #1444 , this re-organizes the code in
utils.py
into a number of separate files in a newutils
folder with code separated by functionality.I'd really like feedback on the naming and organization of this, I made a number of choices to get it done that I'm not totally sure about. Note that I changed the
utils.io
folder toutils.file_io
because flake8 was complaining that theio
name shadowed a python builtin. I don't love that name, happy to hear other suggestions.I added imports for a number of functions directly into the
utils
namespace to prevent errors in other repos. Some of those I deprecated though because I don't think they belong there long term. Also happy to get feedback on this. I tested against:helpers
code into the utils namespace)Are there others I should check?
Motivation and Context
Types of changes
Checklist:
Build or continuous integration change checklist: