VERITAS-Observatory / gammapy-tools

Repository with tools for gammapy analysis
GNU General Public License v3.0
2 stars 0 forks source link

Update template config #36

Open steob92 opened 1 month ago

steob92 commented 1 month ago

@samanthalwong Can you update the config template file. I'm getting key errors when using the template:

KeyError: 'same_szn'
steob92 commented 1 month ago

Also @samanthalwong can you use pre-commit, I'm getting a ton of errors? I can help you set it up if you want:

> pre-commit run --all                                                                       
black....................................................................Failed
- hook id: black
- exit code: 123

error: cannot format gammapy_tools/analysis/data_products_BACKUP_4133860.py: Cannot parse: 43:0: <<<<<<< HEAD
error: cannot format gammapy_tools/analysis/data_products_BACKUP_4133777.py: Cannot parse: 43:0: <<<<<<< HEAD

Oh no! 💥 💔 💥
29 files left unchanged, 2 files failed to reformat.

ruff.....................................................................Failed
- hook id: ruff
- exit code: 1

error: Failed to parse gammapy_tools/analysis/data_products_BACKUP_4133777.py:43:1: Unexpected token '<<'
error: Failed to parse gammapy_tools/analysis/data_products_BACKUP_4133860.py:43:1: Unexpected token '<<'
gammapy_tools/analysis/data_products.py:333:49: F821 Undefined name `geom`
gammapy_tools/analysis/data_products.py:333:72: F821 Undefined name `energy_axis_true`
gammapy_tools/analysis/data_products.py:350:12: F821 Undefined name `plot`
gammapy_tools/analysis/data_products.py:358:36: F821 Undefined name `obs_ids`
gammapy_tools/analysis/data_products.py:358:45: F821 Undefined name `observations`
gammapy_tools/analysis/data_products.py:366:25: F821 Undefined name `norm`
gammapy_tools/analysis/data_products.py:367:21: F821 Undefined name `index`
gammapy_tools/analysis/data_products.py:374:5: F841 Local variable `result_joint` is assigned to but never used
gammapy_tools/analysis/data_products.py:377:12: F821 Undefined name `result_join`
gammapy_tools/analysis/data_products.py:378:16: F821 Undefined name `result_join`
gammapy_tools/analysis/data_products.py:429:5: F841 Local variable `selection` is assigned to but never used
gammapy_tools/analysis/data_products_BACKUP_4133777.py:43:1: E999 SyntaxError: Unexpected token '<<'
gammapy_tools/analysis/data_products_BACKUP_4133860.py:43:1: E999 SyntaxError: Unexpected token '<<'
gammapy_tools/analysis/data_products_LOCAL_4133777.py:310:5: F841 Local variable `selection` is assigned to but never used
gammapy_tools/analysis/data_products_LOCAL_4133860.py:310:5: F841 Local variable `selection` is assigned to but never used
Found 15 errors.
No fixes available (4 hidden fixes can be enabled with the `--unsafe-fixes` option).

flake8...................................................................Failed
- hook id: flake8
- exit code: 1

gammapy_tools/analysis/data_products.py:333:49: F821 undefined name 'geom'
gammapy_tools/analysis/data_products.py:333:72: F821 undefined name 'energy_axis_true'
gammapy_tools/analysis/data_products.py:350:12: F821 undefined name 'plot'
gammapy_tools/analysis/data_products.py:358:36: F821 undefined name 'obs_ids'
gammapy_tools/analysis/data_products.py:358:45: F821 undefined name 'observations'
gammapy_tools/analysis/data_products.py:366:25: F821 undefined name 'norm'
gammapy_tools/analysis/data_products.py:367:21: F821 undefined name 'index'
gammapy_tools/analysis/data_products.py:374:5: F841 local variable 'result_joint' is assigned to but never used
gammapy_tools/analysis/data_products.py:377:12: F821 undefined name 'result_join'
gammapy_tools/analysis/data_products.py:378:16: F821 undefined name 'result_join'
gammapy_tools/analysis/data_products.py:429:5: F841 local variable 'selection' is assigned to but never used
gammapy_tools/analysis/data_products_BACKUP_4133777.py:50:20: E999 SyntaxError: invalid decimal literal
gammapy_tools/analysis/data_products_BACKUP_4133860.py:50:20: E999 SyntaxError: invalid decimal literal
gammapy_tools/analysis/data_products_LOCAL_4133777.py:310:5: F841 local variable 'selection' is assigned to but never used
gammapy_tools/analysis/data_products_LOCAL_4133860.py:310:5: F841 local variable 'selection' is assigned to but never used
samanthalwong commented 1 month ago

Oh oops I totally forgot about the precommit - should I undo the last commit?

steob92 commented 1 month ago

Nah just branch, fix and merge.