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

Fixes for Syntax Errors and other broken stuff #391

Merged
merged 17 commits into from
May 5, 2020
Merged

Fixes for Syntax Errors and other broken stuff #391

merged 17 commits into from
May 5, 2020

Conversation

maxnoe
Copy link
Member

@maxnoe maxnoe commented May 1, 2020

Several things in the current master are broken

I added tests for all scripts to see if at least running the script with --help works and
fixed a lot of simply broken stuff (Syntax errors due to missing or additional commas, missing imports)

ctaplot as dependency was also missing.

For convenience I also added ipython and jupyter to the environment as I just spend 15 Minutes of my life debugging why import ctapipe failed in the lst environment until I realized I was trying with /usr/bin/ipython

The eventio version was incompatible with the one required by ctapipe 0.7

@codecov
Copy link

codecov bot commented May 1, 2020

Codecov Report

Merging #391 into master will decrease coverage by 1.82%.
The diff coverage is 60.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #391      +/-   ##
==========================================
- Coverage   45.83%   44.01%   -1.83%     
==========================================
  Files          68       71       +3     
  Lines        4963     5185     +222     
==========================================
+ Hits         2275     2282       +7     
- Misses       2688     2903     +215     
Impacted Files Coverage Δ
lstchain/scripts/lstchain_dl1_muon_analysis.py 0.00% <ø> (ø)
...n/scripts/onsite/onsite_create_calibration_file.py 0.00% <0.00%> (ø)
...scripts/onsite/onsite_create_drs4_pedestal_file.py 0.00% <0.00%> (ø)
lstchain/calib/camera/calibrator.py 28.20% <40.00%> (ø)
lstchain/calib/camera/__init__.py 100.00% <100.00%> (ø)
lstchain/calib/camera/tests/test_pedestals.py 100.00% <100.00%> (ø)
lstchain/scripts/tests/test_lstchain_scripts.py 98.41% <100.00%> (+0.13%) ⬆️

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 d2f11f8...14d2591. Read the comment docs.

@rlopezcoto
Copy link
Contributor

Regarding including ctaplot as a dependency, we have discussed about it starting here:
#131 (comment)

and then here:
#279

the whole point was:

lstchain/calib/camera/__init__.py Show resolved Hide resolved
@@ -42,7 +42,8 @@ def find_scripts(script_dir, prefix):
install_requires=[
'astropy',
'ctapipe~=0.7.0',
'eventio~=1.0',
'ctaplot',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already discussed in the comments

setup.py Show resolved Hide resolved
@maxnoe
Copy link
Member Author

maxnoe commented May 1, 2020

Regarding including ctaplot as a dependency, we have discussed about it starting here:

But it is a dependency. It's imported in a cli program and used.

Either, you don't want it as a dependency, than it needs to be removed completely or you use it, than it needs to be included.

@maxnoe
Copy link
Member Author

maxnoe commented May 2, 2020

Not to include as a dependency a personal package: @vuillaut said that they were planning to move it to cta-observatory

It seems this has happend: https://github.com/cta-observatory/ctaplot

Copy link
Member

@morcuended morcuended left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change --input_file to --input-file and --output_file to --output-file

@maxnoe
Copy link
Member Author

maxnoe commented May 2, 2020

change --input_file to --input-file and --output_file to --output-file

I would say this has nothing to do with this PR. These are small fixes to obviously broken things.

No API changes are made here.

@morcuended
Copy link
Member

change --input_file to --input-file and --output_file to --output-file

I would say this has nothing to do with this PR. These are small fixes to obviously broken things.

No API changes are made here.

Right, but I was trying to produce new drs4 files with the onsite script and I found it's not working (apart from the os import) because the naming of command line options has not been updated. Since this PR is fixing broken stuff I thought it could fit here as well. I can open a new PR if not.

@rlopezcoto
Copy link
Contributor

It seems this has happend: https://github.com/cta-observatory/ctaplot

great, what about the other point @vuillaut?

@rlopezcoto
Copy link
Contributor

Right, but I was trying to produce new drs4 files with the onsite script and I found it's not working (apart from the os import) because the naming of command line options has not been updated. Since this PR is fixing broken stuff I thought it could fit here as well. I can open a new PR if not.

I only modified the scripts within scripts/, did not want to touch those under scripts/onsite/ not to mess things up more for LSTOSA, but @morcuended it would be great if you can adapt them to the same naming as in #380

@maxnoe
Copy link
Member Author

maxnoe commented May 2, 2020

great, what about the other point @vuillaut?

This point doesn't really matter to this PR. RIght now, in the master branch, ctaplot is a dependency.
Thus it goes into setup.py.

If you want to get rid of this depedency, do it. But as long as it is used, it belongs in setup.py.

@rlopezcoto
Copy link
Contributor

There are at the moment two scripts where ctaplot is used:
lstchain_mc_rfperformance
lstchain_mc_sensitivity

It is included as an option in the first one:

try:
    import ctaplot
except ImportError as e:
    print("ctaplot not installed, some plotting function will be missing")

could you include it as an option on the second one instead of including it in the setup until this is worked out?

@morcuended morcuended dismissed their stale review May 3, 2020 11:09

This change does not belong here

@morcuended
Copy link
Member

I updated the branch with master latest changes (don't know if I should have done it) and now the tests are failing because of onsite scripts. Otherwise, it seems fine to me.

@maxnoe
Copy link
Member Author

maxnoe commented May 3, 2020

@morcuended sure, no problem

@maxnoe
Copy link
Member Author

maxnoe commented May 3, 2020

@morcuended what's the matter with the onsite scripts?

Ah, found it. there is the __init__.py missing, and that's why it's not included by find_packages

morcuended
morcuended previously approved these changes May 3, 2020
@maxnoe maxnoe merged commit fd88b77 into master May 5, 2020
@maxnoe maxnoe deleted the fixes branch May 5, 2020 07:51
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