-
Notifications
You must be signed in to change notification settings - Fork 270
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
include stage1_config.json in package #1752
include stage1_config.json in package #1752
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 great, thanks.
Two points:
a) I would probably just add the json file into a resources
directory in ctapipe/tools/tests/resources
. It is in this case not really an example, but a non-code file needed for the tests.
b) wee need to add importlib_resources
to the required packages for python < 3.9.
Yes, that is what I meant. Not really an example in this case anymore. But should we keep this also in the top-level
Is it possible to require this only if python < 3.9 ? I just put it into |
Codecov Report
@@ Coverage Diff @@
## master #1752 +/- ##
==========================================
- Coverage 92.04% 91.78% -0.26%
==========================================
Files 187 187
Lines 14696 14706 +10
==========================================
- Hits 13527 13498 -29
- Misses 1169 1208 +39
Continue to review full report at Codecov.
|
for future reference: yes you can, with environment markers from pep 508 |
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 needed to add "resouces/*" to package data to make setuptools include a json file in ctapipe/tools/tests/resources/
to the wheels / source dists:
81 ⋮ 81 │ ],
82 ⋮ 82 │ zip_safe=False,
83 ⋮ 83 │ entry_points=entry_points,
84 ⋮ │ package_data={"": ["tools/bokeh/*.yaml", "tools/bokeh/templates/*.html"]},
⋮ 84 │ package_data={
⋮ 85 │ "": [
⋮ 86 │ "tools/bokeh/*.yaml",
⋮ 87 │ "tools/bokeh/templates/*.html",
⋮ 88 │ "resources/*",
⋮ 89 │ ]
⋮ 90 │ },
85 ⋮ 91 │)
I can reproduce that issue, after cleaning up ( weird, that the tests still pass .. |
Maybe it would be worth to use this setup in the CI to make sure it works. So I'd suggest to remove the |
It may be worth waiting for #1726 since that introduces several more "standard" config files that need to be used for testing. I only haven't had time to write the tests. Of course, we eventually need to create a configuration repo in the CTA-GitLab to keep track of real (non-testing) configurations. Which reminds me, it may be nice to allow configurations from a git repo rather than only as local files, using the same URL scheme that we use for other files. That way we can specify a path like |
Wouldn't it make sense to do it the other way around? Merge this here first and then you can just add those new config files to the |
Yes that's also ok. It has just been hard to maintain that branch with all the changes |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
ouch, it seems like I need to review how to do git |
c0f480d
to
d88c8e7
Compare
sorry if anyone was notified unnecessarily. I now added the resources for the ProcessorTool and resolved the conflicts that were shown |
The only issue I have here is that these configs really are examples, that the user may want to take and modify, not just used for testing. They are supposed to define the reference analysis. So perhaps we should keep two copies of them? One for tests, and one for examples? Otherwise they are now hard to find. Or perhaps better yet: we could make a To start it could be really simple: it has no options other than % ls
% ctapipe-quickstart
% ls
stage1_config.json stage2_config.json training_config.json And it would internally get the files using the package resources and writes them to the directory. |
By the way, could we not just put these configs on the datatserver in the latest version of ctapipe-extra like we do with all other testing files? Thatt would make this PR unneeded, since you could just use |
I guess that these files will need updates more often than data files. Which makes putting them on the data server really suboptimal, since only very limited number of people have access to them and somebody preparing a PR that needs configs to be adjusted cannot do it while developing. Also, these are small text files, so are well suited for git. |
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.
Ok let's merge this then, and I'll open a PR for a tool to extract them for users,.
I included the
stage1_config.json
inctapipe/examples
, so the tests can use the packaged one. However, I am not sure about the naming of the directory.This will fix #1750