Remove version pins and unused imports
I just tried to install pygwb in one of my development environments and noticed that it is pinning a lot of versions of things to exact versions. This is generally not great practice for something that is intended as a library that interacts with other code, see, e.g., this discussion. I'll note that a commonly used practice when pinning packages is to add a comment describing why the pin is there, potentially with a link to a related issue. Currently pinned I see:
-
scipy==1.8.0
: this was pinned as part of !81 (merged), it doesn't look like a reason was given for this. -
gwpy==3.0.1
,lalsuite==7.3
: it looks like these were pinned recently. Is this to have a specific version for review/testing? If so, there are other ways to specify this, without stopping users from using the code with other versions that would presumably still work. Also, this lalsuite version is more than a year old. -
jinja2==3.0.3
: this package isn't actually used by pygwb and so shouldn't be listed as an install requirement. This was added to fix the documentation generation. There are a few options to get around this, we can define additional testing dependencies or just install the version be hand in the documentation job.
I decided to just remove all of these pins and see what happens. The tests don't seem to be breaking, but I don't know if there are, e.g., pipeline tests that wouldn't show problems in the CI.
As I was checking which were needed I noticed that the project is littered with unused imports.
After removing these imports I noticed that one of the eval
statements was broken. As this is generally not a safe thing to have in code, especially when reading inputs (as is done in the detector). I either removed these or narrowed the scope of what can be evaluated.