Skip to content
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

ctapipe-quickstart tool #1774

Merged
merged 14 commits into from
Sep 1, 2021
Merged

Conversation

kosack
Copy link
Contributor

@kosack kosack commented Aug 3, 2021

adds a simple tool to generate a working directory containing the latest configuration files, since they are no longer available in ctapipe/examples. You can specify contact info using the command-line options, or if you don't, it prompts the user for the relevant info. The contact info is then filled into the config files that are generated.

% ctapipe-quickstart --workdir "ProdX"
Enter your contact name: Some User
Enter your contact email: [email protected]
Enter your organization: CERN
Generated examples in ./ProdX

% ls ProdX

README.md
stage1_config.json
stage2_config.json
training_config.json

% cat ProdX/stage1_config.json 
{
    "DataWriter": {
        "Contact": {
            "name": "Some User",
            "email": "[email protected]",
            "organization": "CERN"
        },
        "overwrite": false,
        "write_images": true,
        "write_parameters": true,
        "write_stereo_shower": false,
        "write_mono_shower": false,
        "transform_image": true,
        "transform_peak_time": true
    },
    "CameraCalibrator": {
        "image_extractor_type": "NeighborPeakWindowSum"
    },
    "ImageProcessor": {
        "image_cleaner_type": "TailcutsImageCleaner",
        "TailcutsImageCleaner": {
            "picture_threshold_pe": [
                ["type", "*", 10.0],
...

@codecov
Copy link

codecov bot commented Aug 3, 2021

Codecov Report

Merging #1774 (9041e4d) into master (a4b8e54) will decrease coverage by 0.07%.
The diff coverage is 84.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1774      +/-   ##
==========================================
- Coverage   91.84%   91.76%   -0.08%     
==========================================
  Files         187      188       +1     
  Lines       14827    14908      +81     
==========================================
+ Hits        13618    13681      +63     
- Misses       1209     1227      +18     
Impacted Files Coverage Δ
ctapipe/io/metadata.py 96.90% <75.00%> (-1.97%) ⬇️
ctapipe/tools/quickstart.py 81.03% <81.03%> (ø)
ctapipe/tools/tests/test_process.py 96.00% <100.00%> (+0.70%) ⬆️
ctapipe/utils/filelock.py 76.19% <0.00%> (-23.81%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a4b8e54...9041e4d. Read the comment docs.

@HealthyPear
Copy link
Member

we could use this to do what I do in the interface for protopipe...

https://github.com/HealthyPear/protopipe-grid-interface/blob/master/create_analysis_tree.py

@kosack
Copy link
Contributor Author

kosack commented Aug 4, 2021

we could use this to do what I do in the interface for protopipe...

Yes that's the idea: in the future it would create a full directory structure and fill in some variables in the config files, which are used as templates. For now, I wanted to start simply just to be able to run a basic analysis, but we can definitely extend this to be more fancy.

Though if you want, we could just copy your code into it now (or leave that for a future PR?)

In any case, just noticed I need a test... I'll add one

kosack added 3 commits August 4, 2021 11:09
It now has options to specify the contact info,
and will prompt if that info is missing.  It will be filled
into the generated config files.
@kosack
Copy link
Contributor Author

kosack commented Aug 4, 2021

added one new feature: the contact information is now filled in from user options (prompted if the user forgets it), so the resulting config file has the correct contact name, email, and organization.

kosack added 3 commits August 4, 2021 14:02
- moved tests to test_process (since it is related)
- use better placeholder text, and add missing placeholders to configs
@kosack kosack requested review from HealthyPear and maxnoe August 4, 2021 15:06
@HealthyPear
Copy link
Member

Though if you want, we could just copy your code into it now (or leave that for a future PR?)

I'll check and test it

@kosack
Copy link
Contributor Author

kosack commented Aug 5, 2021

Since I'm away, I think let's just start simple with this one, and not yet add the feature to generate the full directory structure. That can be a PR we add later, when @HealthyPear start to merge the features of protopipe (and maybe it's not needed to be as fancy as protopipe here)

ctapipe/tools/quickstart.py Outdated Show resolved Hide resolved
@kosack kosack merged commit 63e0df4 into cta-observatory:master Sep 1, 2021
@kosack kosack deleted the feature/quickstart branch September 1, 2021 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants