Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
307 commits
Select commit Hold shift + click to select a range
9645a06
comment out one tutorial that takes a really long time to run (but
Feb 3, 2026
4d453a7
* add faster, non-quadrature-based integration for common functions, …
Feb 3, 2026
ba5be17
* add faster, non-quadrature-based integrals for common functions,
Feb 3, 2026
3fbdef5
adjust custom_functions code after header cleanup
Feb 3, 2026
435c8e4
one more missing import
Feb 3, 2026
d27b32c
remove old_div from custom function Wide_Asymm_Gaussian_on_sphere, since
Feb 3, 2026
50962e5
* take advantage of _setup in Astromodels Functions to avoid
Feb 4, 2026
f906ff5
* ExtendedSourceResponse should be initialized the same whether
Feb 4, 2026
711a104
cosmetic cleanups
Feb 4, 2026
64ebc3c
* fix output renaming for .h5 after compressed/uncompressed .rsp support
Feb 4, 2026
a28ffc7
* clean up excess output and remove warnings from diffuse_511_spectra…
Feb 4, 2026
d341fc6
support Gaussian normalization
Feb 4, 2026
99bed81
Merge pull request #466 from McKelvey-Engineering-CSE/new_integrate_c…
israelmcmc Feb 4, 2026
dc747fb
* add single-Ei-bin test response to test Mono normalization with no …
Feb 4, 2026
3b02b6a
Merge branch 'develop' into rsp_norm_fix_clean
Feb 4, 2026
841e64d
Merge branch 'develop' into sf_fits_clean
Feb 4, 2026
95508dd
Replace print() statements with logger.info() in pipeline tasks (fixe…
Feb 5, 2026
05069f8
Remove old file format compatibility check for DC4 (fixes #428)
Feb 5, 2026
6f582ae
Remove warning about HIERARCH card creation
Feb 5, 2026
5ce012f
remove warnings from spectral fitting test case
Feb 5, 2026
24f9ce6
limit parameter in test to avoid overflow warning
Feb 5, 2026
292f712
clean up spectral fitting notebooks and regenerate output
Feb 5, 2026
d0f4833
further notebook cleanup
Feb 5, 2026
a4f1924
Merge pull request #463 from McKelvey-Engineering-CSE/rsp_norm_fix_clean
GallegoSav Feb 6, 2026
3d6bedd
Merge branch 'cositools:develop' into sf_fits_clean
jdbuhler Feb 6, 2026
7206e56
Merge branch 'cositools:develop' into misc_cleanups
jdbuhler Feb 6, 2026
c055e67
Merge pull request #469 from McKelvey-Engineering-CSE/misc_cleanups
israelmcmc Feb 6, 2026
83729b8
Revert print() statements in cosi_threemlfit to use print() instead o…
team-narcos Feb 6, 2026
765caaa
* fix issue with COSILike and SpacecraftFile potentially using a
Feb 6, 2026
59752d7
make ts_map work even if the provided orientations use a coordinate
Feb 6, 2026
c5bcf26
test that COSILike and source path computation work correctly
Feb 6, 2026
4b8d9c7
Use galactic specification of Point Source center everywhere in tutorial
Feb 6, 2026
cf7db39
Merge branch 'develop' into sf_fits_clean
Feb 6, 2026
4d933b9
fix up tutorial notebooks that changed in develop to use FITS orienta…
Feb 6, 2026
b6de516
Merge branch 'sf_fits_clean' of https://github.com/McKelvey-Engineeri…
Feb 6, 2026
2dba754
Merge pull request #468 from abhijeetnardele24-hash/develop
GallegoSav Feb 9, 2026
8471404
Merge branch 'cositools:develop' into sf_fits_clean
jdbuhler Feb 9, 2026
3532e4a
Merge branch 'cositools:develop' into coord_fix
jdbuhler Feb 9, 2026
87a21e9
Add fluctuate parameter to source injector
GallegoSav Feb 9, 2026
b563ac2
Fix spacing in Poisson function call
GallegoSav Feb 9, 2026
fdc92e0
Update source_injector.py
GallegoSav Feb 9, 2026
f166897
Merge branch 'develop' into coord_fix
Feb 9, 2026
1704cb6
Add numpy import to source_injector.py
GallegoSav Feb 10, 2026
1306c73
Set default 'fluctuate' parameter to True
GallegoSav Feb 10, 2026
55db870
Merge pull request #472 from GallegoSav/develop
GallegoSav Feb 10, 2026
4f64723
hopefully last test :)
nmik Feb 10, 2026
7944ab1
hopefully last test :)
nmik Feb 10, 2026
2a8710f
remove duplicated open of extended response
Feb 11, 2026
38e3680
Merge branch 'coord_fix' of https://github.com/McKelvey-Engineering-C…
Feb 11, 2026
e620b0d
Merge branch 'cositools:develop' into coord_fix
jdbuhler Feb 11, 2026
2a49225
Merge branch 'coord_fix' of https://github.com/McKelvey-Engineering-C…
Feb 11, 2026
a0bd501
Merge branch 'develop' into sf_fits_clean
Feb 11, 2026
c557fc2
Merge pull request #470 from McKelvey-Engineering-CSE/coord_fix
GallegoSav Feb 12, 2026
edfe901
Merge branch 'cositools:develop' into sf_fits_clean
jdbuhler Feb 12, 2026
45ee445
* speedups for SpacecraftFile math
Feb 12, 2026
fdf80cf
actually bump scipy to 1.15
Feb 12, 2026
b924087
* exercise earth occ caching code in test suite
Feb 12, 2026
0ce35f0
exercise getter as well as setter for cache_earth_occ
Feb 12, 2026
5e3a419
Merge pull request #476 from McKelvey-Engineering-CSE/sc_speedup_clean
GallegoSav Feb 13, 2026
f9c3f68
Create fake test data and background using the same response as the f…
israelmcmc Feb 13, 2026
3e00ff2
Merge branch 'develop' into sf_fits_clean
Feb 13, 2026
41adb97
Merge branch 'develop' into develop_make_spectral_fit_test_circular
israelmcmc Feb 13, 2026
5a8b7ec
update new test case to use FITS
Feb 13, 2026
eea4671
Complete merge (keep new test introduced in c5bcf26)
israelmcmc Feb 13, 2026
f497b3b
Make test easier to update
israelmcmc Feb 13, 2026
bc7a031
Use the correct source.
israelmcmc Feb 13, 2026
367ccea
Use the correct source.
israelmcmc Feb 13, 2026
d8c161b
Move initial guess slightly away from true values
israelmcmc Feb 13, 2026
ee6a8bf
Merge pull request #480 from israelmcmc/develop_make_spectral_fit_tes…
eneights Feb 13, 2026
d5a8f4e
Resolve conflicts
eneights Feb 13, 2026
78c2b14
Fix typo
eneights Feb 13, 2026
9be206f
Merge branch 'develop' into develop
eneights Feb 13, 2026
59594e9
Merge pull request #443 from eneights/develop
israelmcmc Feb 13, 2026
656e58c
Merge branch 'cositools:develop' into sf_fits_clean
jdbuhler Feb 15, 2026
fdd46b2
update new polarization test/tutorial to use FITS orientation files
Feb 15, 2026
717feba
close subfigures after plotting; make sure we show() first
Feb 16, 2026
f74cbd3
Merge pull request #464 from McKelvey-Engineering-CSE/sf_fits_clean
GallegoSav Feb 16, 2026
71a9fff
Merge pull request #481 from McKelvey-Engineering-CSE/close_subplots_…
GallegoSav Feb 16, 2026
efcbe1e
Temporary workaround for 3ML circular import while waiting for release.
israelmcmc Feb 16, 2026
193b574
matplotlib version restriction no longer needed with new 3ML version.
israelmcmc Feb 16, 2026
d544e7c
Merge pull request #483 from israelmcmc/develop_3MLdev
israelmcmc Feb 16, 2026
e5919a4
* dwell map cannot take a polarization convention; don't assume it ca…
Feb 16, 2026
c8f9658
Revert "Remove old file format compatibility check for DC4 (fixes #428)"
israelmcmc Feb 16, 2026
29ac162
Merge pull request #485 from israelmcmc/develop_revertCOseq
israelmcmc Feb 16, 2026
e7eb706
Merge branch 'develop' into nb-fix
Feb 16, 2026
ebb34b1
Merge pull request #486 from McKelvey-Engineering-CSE/nb-fix
israelmcmc Feb 16, 2026
644ad39
* add ML polarization notebook to auto-runnable tutorials list
Feb 16, 2026
4b2a368
per Israel's request, each polarization notebook is now a separate entry
Feb 16, 2026
2db2ee7
Merge pull request #488 from McKelvey-Engineering-CSE/ml-polar-notebook
GallegoSav Feb 17, 2026
97a373c
Fix bug. Introduced during EmCDSEventInSCFrame/TimeTagEmCDSEventInSCF…
israelmcmc Feb 17, 2026
d80c06d
removed unused functions
nmik Feb 17, 2026
86cab4c
added more testing
nmik Feb 17, 2026
3d1fb0c
accounting for reacent changes in ori files
nmik Feb 17, 2026
aa796c1
Merge pull request #246 from nmik/develop
eneights Feb 17, 2026
43faf53
Merge remote-tracking branch 'fork/savitri_interfaces_extended' into …
israelmcmc Feb 17, 2026
d662e83
* fix polarization stokes tutorial to run in latest develop tree
Feb 17, 2026
ec6a0d6
Merge pull request #490 from McKelvey-Engineering-CSE/stokes-tutorial
israelmcmc Feb 18, 2026
deee9f0
Move setup.py to .toml file. Supports poetry and setuptools.
israelmcmc Feb 18, 2026
4732437
Update python version in unit tests.
israelmcmc Feb 18, 2026
c9a79af
Merge pull request #13 from israelmcmc/interfaces_toml
israelmcmc Feb 18, 2026
96954f5
Add pytorch as optional dependency. Add unit test using it.
israelmcmc Feb 18, 2026
09f6602
Update name of unit_tests_ml.yml
israelmcmc Feb 18, 2026
63347d9
Merge pull request #14 from israelmcmc/interfaces_ml
israelmcmc Feb 18, 2026
70756b2
Modify BinnedExpectationInterfaces
israelmcmc Feb 19, 2026
1ad3aa5
Fix test. Broken in 70756b2a7a3d519b786433280fe5d85e5118756a
israelmcmc Feb 19, 2026
67e48bd
Crab spectral fit tutorial working with new interfaces.
israelmcmc Feb 19, 2026
9ed1a5f
Crab spectral fit tutorial working with new interfaces. Now for real.
israelmcmc Feb 19, 2026
f495c15
Fix error in polarization_stokes.py and notebook output
eneights Feb 20, 2026
ed651df
Update ASAD method notebook to work with interfaces
eneights Feb 20, 2026
de7cc2b
Merge pull request #491 from eneights/develop
israelmcmc Feb 20, 2026
0d52aad
Merge pull request #15 from eneights/interfaces
israelmcmc Feb 20, 2026
2eb07d0
Merge branch 'develop' into interfaces_develop
israelmcmc Feb 20, 2026
6452f80
Halfway through the interfaces-develop merge. Currently fixing Spacec…
israelmcmc Feb 20, 2026
e1d3274
* Reintroduce exposure, earth occ, and scatt_map speedups to
Feb 21, 2026
eb67737
add new test data file from develop
Feb 21, 2026
84a5e97
update remaining API usage of get_dwell_map
Feb 21, 2026
fed9271
cleanup imports for XSpec test cases
Feb 21, 2026
a512b95
Make a valiant (but unsuccessful) attempt to recover the
Feb 21, 2026
0ff6a03
record complaints about .altitude and .earth_zenith
Feb 21, 2026
60a6a2f
minor test case cleanups
Feb 21, 2026
3274dfb
* add type annotations to more of SpacecraftHistory
Feb 21, 2026
735f1d5
get_source_visibility() should not need a separate earth_occ parameter.
Feb 21, 2026
2724e79
* work around bug with overwrite processing in Astropy Table FITS I/O
Feb 21, 2026
2ba317f
Preliminary solution to 'Removing the source+bkg merging step #453'. …
jbotha-sketch Feb 23, 2026
99b83f8
extended source tutorial update
GallegoSav Feb 23, 2026
5f874cc
update run tutorials
GallegoSav Feb 23, 2026
2f98c24
bring response conversion code up to develop + relative response patch
Feb 23, 2026
18311a1
add actual RspConverter change
Feb 23, 2026
3ce5abd
add test case files for relative response
Feb 23, 2026
e3fc286
add test case from develop for RspConverter norms
Feb 23, 2026
2620fdf
Merge pull request #18 from McKelvey-Engineering-CSE/interfaces-rsp-c…
israelmcmc Feb 23, 2026
bbe656a
Merge branch 'interfaces' into interfaces_develop
israelmcmc Feb 24, 2026
d8d5eb9
* use Israel's code to convert more accurately between
Feb 24, 2026
3eaaac4
convert users of .ori files in Python code (note notebook code)
Feb 24, 2026
37f0b6a
Add FITS versions of test case files
Feb 24, 2026
be83dd4
Make sure test case YAML files refer to FITS orientation files
Feb 24, 2026
3ac5e53
Merge branch 'interfaces' into interfaces-sc-fixes
Feb 24, 2026
df90255
Fix bug. This line wasn't updated after the get_basis_local change of…
israelmcmc Feb 24, 2026
6f1af19
* Astropy's coordinate concatenation is deprecated. Use np.concatenate
Feb 24, 2026
de7b690
upgrade the run tutorial
GallegoSav Feb 24, 2026
7608df8
Removed the merge step for signal+bkg.
jbotha-sketch Feb 24, 2026
a95bd32
Reverted back to original diffuse_511 file
jbotha-sketch Feb 24, 2026
2d5ec0a
replace fits by ori
GallegoSav Feb 24, 2026
9be6f99
Merge pull request #16 from McKelvey-Engineering-CSE/interfaces-sc-fixes
israelmcmc Feb 24, 2026
5472300
Merge pull request #17 from GallegoSav/interfaces
israelmcmc Feb 24, 2026
8ec3e1d
Merge branch 'interfaces' into interfaces_develop
israelmcmc Feb 24, 2026
1abe6ab
Fix the imports to allow all tests to run. Otherwise they fail at col…
israelmcmc Feb 24, 2026
5cede8e
Merge pull request #493 from jbotha-sketch/remove-merge-step
israelmcmc Feb 24, 2026
132a787
Merge branch 'develop' into interfaces_develop
israelmcmc Feb 24, 2026
14a5e79
Bring back change from 9a776b5 that fell through the interfaces refac…
israelmcmc Feb 24, 2026
ef7708a
Fix error in point source response
eneights Feb 24, 2026
33cfae1
Add MLM notebook
eneights Feb 24, 2026
7076a13
Add MLM unit test
eneights Feb 24, 2026
279e0a2
Add MLM test data
eneights Feb 24, 2026
70cd1bc
Fix polarization handling in 3ML psr
eneights Feb 24, 2026
41dd134
Update for astropy>=7.2.0
israelmcmc Feb 24, 2026
d5d7c96
Merge branch 'interfaces' into interfaces_develop
israelmcmc Feb 24, 2026
a6d9b1e
* FITS orientation files should store a unit for *every* column, and
Feb 25, 2026
1135ef7
Make sure altitude is saved as a Quantity, not a Distance
Feb 25, 2026
19d492e
add light_curves folder
albiciaco Feb 25, 2026
0e3a835
don't copy data as it is about to be written out to FITS file
Feb 25, 2026
c87273a
remove a couple more copies in open()
Feb 25, 2026
ba0e774
Fix for new version of astropy.
israelmcmc Feb 25, 2026
e962a09
Roll back to .ori. Faster for now since it doesn't load the whole file
israelmcmc Feb 25, 2026
1d13e08
upgrade gal diff continuum tutorial
GallegoSav Feb 26, 2026
98c3e91
blabla
GallegoSav Feb 26, 2026
27ef8b8
Fix polarization handling
eneights Feb 26, 2026
d590775
Fix polarization handling
eneights Feb 26, 2026
97af516
Fix kwargs typing for BackgroundInterface. See PEP 692
israelmcmc Feb 26, 2026
d14e194
Fix ref_vector property. It was causing a RecursionError while callin…
israelmcmc Feb 26, 2026
b4fbd81
Merge branch 'interfaces' into interfaces_develop
israelmcmc Feb 26, 2026
d6138c4
Merge pull request #19 from McKelvey-Engineering-CSE/interfaces-unitfix
israelmcmc Feb 26, 2026
34d973a
Merge branch 'interfaces' into interfaces_develop
israelmcmc Feb 26, 2026
02f3546
Update to newest threeml release.
israelmcmc Feb 26, 2026
4e09165
Update to newest threeml release.
israelmcmc Feb 26, 2026
23fd2fb
Merge pull request #495 from israelmcmc/develop_update_threeml
israelmcmc Feb 26, 2026
8c2ba42
Merge pull request #21 from israelmcmc/interfaces_update_threeml
israelmcmc Feb 26, 2026
7197e05
Merge branch 'interfaces' into interfaces_develop
israelmcmc Feb 26, 2026
1697498
Merge branch 'develop' into interfaces_develop
israelmcmc Feb 26, 2026
b9e0ae8
Fix stokes method tests. Update to interfaces refactoring.
israelmcmc Feb 26, 2026
8643225
Save tutorial as python script as well. Convert also to html before e…
israelmcmc Feb 26, 2026
b26406a
Merge branch 'interfaces' into interfaces_develop
israelmcmc Feb 26, 2026
a8c050a
Update DC3_final_530km_3_month_with_slew_1sbins_GalacticEarth_SAA.fit…
israelmcmc Feb 26, 2026
074aae8
Fix Stokes tutorial. Update to interfaces refactoring.
israelmcmc Feb 26, 2026
a7df68b
Revert to using TiemAxis.find_bin instead of np.searchsorted (faster)
israelmcmc Feb 26, 2026
d5887af
Merge branch 'interfaces' into interfaces_develop
israelmcmc Feb 26, 2026
a6b7b0a
Fix ts map test. Update for interfaces refactoring.
israelmcmc Feb 26, 2026
04a6933
Fix run_tutorials.yml formatting and file names
israelmcmc Feb 26, 2026
9e8b08f
Fix file name
israelmcmc Feb 26, 2026
bbcf9c3
Merge branch 'interfaces' into interfaces_develop
israelmcmc Feb 26, 2026
686659c
update light curve tutorial to interfaces
albiciaco Feb 27, 2026
82de300
Refactor fitting and IO modules to use SpacecraftHistory and update f…
albiciaco Feb 27, 2026
37f1f44
update app tutorial to interfaces
albiciaco Feb 27, 2026
2790577
Fix extended source tutorial. Match recent changes in develop.
israelmcmc Feb 27, 2026
8f6ebe2
Merge 98c3e91c3c640f11597a62462b25ba460e19a83f into 9e8b08f1e84bce1ee…
GallegoSav Feb 27, 2026
6e9bf69
Changes to relative path so it works with run_tutorials.py
israelmcmc Feb 27, 2026
88b3e4b
Merge branch 'interfaces' into interfaces_develop
israelmcmc Feb 27, 2026
145482e
Update DC3_final_530km_3_month_with_slew_1sbins_GalacticEarth_SAA.fit…
israelmcmc Feb 27, 2026
f17a53b
Fix imaging_511_time_binning tutorial. Update to SpacecraftHistory
israelmcmc Feb 27, 2026
f3f8751
Fix ts_map tutorial.
israelmcmc Feb 27, 2026
aebc58a
Merge remote-tracking branch 'israel/interfaces' into interfaces
eneights Feb 27, 2026
4af43e8
Fix response tutorial.
israelmcmc Feb 27, 2026
9ea4a6e
Fix bug
eneights Feb 27, 2026
0a4d43d
Add MLM polarization notebook
eneights Feb 27, 2026
f32e8e1
Update to handle polarization
eneights Feb 27, 2026
be98fd6
Fix unit test
eneights Feb 27, 2026
3820315
Fix typos
eneights Feb 27, 2026
2257a4a
Fix psr test
eneights Feb 27, 2026
8a45d03
Fix bug. Handle case when source is None.
israelmcmc Feb 27, 2026
395b60f
Merge branch 'interfaces' into interfaces_develop
israelmcmc Feb 27, 2026
174d602
PA fix
eneights Feb 27, 2026
3219e60
Merge 174d602dd5164ff2bf5d21078038b6668923cfa3 into 8a45d03e06609b05f…
eneights Feb 27, 2026
89a04be
Fix terrible awful performance bug caused by comparing two
Mar 2, 2026
4a24198
fix the spacecraft tuto
GallegoSav Mar 2, 2026
d765cd5
Merge remote-tracking branch 'fork/pull/23/merge' into interfaces_dev…
israelmcmc Mar 2, 2026
22c4645
Merge pull request #23 from eneights/interfaces
israelmcmc Mar 2, 2026
128add4
Merge branch 'interfaces' into interfaces_develop
israelmcmc Mar 2, 2026
f684c95
Merge 37f1f447f2ad7233c9ba94c394c04893d27f1630 into 22c46458701263d0c…
albiciaco Mar 2, 2026
32daca1
Merge branch 'interfaces' into interfaces
israelmcmc Mar 2, 2026
fb09325
Merge 32daca1381feffc841448282e252f635d943af9f into 22c46458701263d0c…
GallegoSav Mar 2, 2026
236caef
Remove get_target_in_sc_frame from tutorial since it was deprecated i…
israelmcmc Mar 2, 2026
66dc2ad
Merge branch 'interfaces' into interfaces_develop
israelmcmc Mar 2, 2026
b124c75
Fix SC file for interfaces_develop
israelmcmc Mar 2, 2026
3801fde
Fix RspArfRmfConverter unit tests after latest API change.
israelmcmc Mar 2, 2026
be6aa13
Merge pull request #24 from McKelvey-Engineering-CSE/if-interp-fix
israelmcmc Mar 2, 2026
6c66ccf
Merge branch 'interfaces' into interfaces_develop
israelmcmc Mar 2, 2026
781c3af
Fix RspArfRmfConverter unit tests after latest API change.
israelmcmc Mar 2, 2026
7fbc3cf
Vectorize SumExpectationDensity in expectation_interface
Mar 3, 2026
3f650d3
Update checksum
israelmcmc Mar 3, 2026
b4c5bec
Finished refactoring the SpectralFit_GRB tutorial. Everything seems g…
jbotha-sketch Mar 3, 2026
b09e10a
Add lightcurves tutorial to run_tutorials.yml
israelmcmc Mar 4, 2026
d9f7b02
Merge branch 'interfaces_PR22' into interfaces
israelmcmc Mar 4, 2026
d9c0c21
Merge 7fbc3cf002089cd4795723ff2fd387cb93bef910 into d9f7b020b99d47014…
scipascal Mar 4, 2026
1a150c2
Document new vectorize flag
israelmcmc Mar 4, 2026
53f2c58
Merge branch 'interfaces' into interfaces_develop
israelmcmc Mar 4, 2026
37ffc36
Potentially fixed the issue with the last plot. I believe I made some…
jbotha-sketch Mar 4, 2026
70e8358
Renamed SpectralFit_GRB_new.ipynb to SpectralFit_GRB_ipynb and delete…
jbotha-sketch Mar 4, 2026
e4e6dbf
Remove duplicate SpectralFit_GRB_new notebook
jbotha-sketch Mar 4, 2026
20210a4
Merge e4e6dbfd916b5b4f7f4fd87b160ef72c96e9a318 into 1a150c2a8cddf3c94…
jbotha-sketch Mar 4, 2026
dc8cf38
Updated source_injector.py and the Point_source_injector.ipynb tutori…
krishnatejavedula Mar 5, 2026
40e37b9
Merge dc8cf383bb080ef05a993fe12a16070414dd8abb into 1a150c2a8cddf3c94…
krishnatejavedula Mar 5, 2026
3c4cee4
Fix spectral_fit_grb in run_tutorials.yml
israelmcmc Mar 5, 2026
c08003a
Merge branch 'interfaces' into interfaces_develop
israelmcmc Mar 5, 2026
3f11916
Fix bugs in get_source_visibility
israelmcmc Mar 6, 2026
ecb1cb6
Remove also magic lines, not just magic cells
israelmcmc Mar 6, 2026
9ba8855
Merge remote-tracking branch 'fork/pull/29/merge' into interfaces_PR29
israelmcmc Mar 6, 2026
21a35c7
Use earth_occ = True again now that SpacecraftHistory was fixed in 3f…
israelmcmc Mar 6, 2026
266e133
Merge branch 'interfaces' into interfaces_develop
israelmcmc Mar 6, 2026
dac7455
Option to exclude certain tutorial
israelmcmc Mar 9, 2026
7721caa
Merge branch 'interfaces' into PR498
israelmcmc Mar 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
python-version: ["3.12"]

steps:
- uses: actions/checkout@v4
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/unit_tests_ml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: unit_tests_ml

on: [push, pull_request]

jobs:
tests:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install
run: |
python -m pip install --upgrade pip
pip install ".[ml]"
- name: Tests
run: |
pip install pytest pytest-cov
pytest tests --junitxml=junit/test-results.xml --cov=cosipy --cov-report=xml --cov-report=html
- name: Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true

7 changes: 6 additions & 1 deletion cosipy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
from ._version import __version__
try:
from importlib import metadata
__version__ = metadata.version("cosipy")
except metadata.PackageNotFoundError:
# Handle cases where the package is not installed (e.g., running directly from source)
__version__ = "unknown"

from .response import DetectorResponse

Expand Down
14 changes: 5 additions & 9 deletions cosipy/background_estimation/free_norm_threeml_binned_bkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ def norms(self):
if self._single_component:
return {self._default_label: u.Quantity(self._norms[0], u.Hz)}
else:
return {l:u.Quantity(n, u.Hz, copy = False) for l,n in zip(self.labels,self._norms)}
return {l:u.Quantity(n, u.Hz, copy = None) for l,n in zip(self.labels,self._norms)}

@property
def ncomponents(self):
return len(self._distributions)

@property
def meausured_axes(self):
def axes(self):
return self._axes

@property
Expand All @@ -137,7 +137,7 @@ def set_norm(self, norm: Union[u.Quantity, Dict[str, u.Quantity]]):

self._norm = sum(n for n in self._norms)

def set_parameters(self, **parameters:Dict[str, u.Quantity]) -> None:
def set_parameters(self, **parameters:u.Quantity) -> None:
"""
Same keys as background components
"""
Expand All @@ -157,12 +157,11 @@ def __init__(self, *args, **kwargs):
self._expectation = None
self._last_norm_values = None

def expectation(self, axes:Axes, copy:bool = True)->Histogram:
def expectation(self, copy:bool = True)->Histogram:
"""

Parameters
----------
axes
copy:
If True, it will return an array that the user if free to modify.
Otherwise, it will result a reference, possible to the cache, that
Expand All @@ -173,13 +172,10 @@ def expectation(self, axes:Axes, copy:bool = True)->Histogram:

"""

if axes != self.meausured_axes:
raise ValueError("Requested axes do not match the background component axes")

# Check if we can use the cache
if self._expectation is None:
# First call. Initialize
self._expectation = Histogram(self.meausured_axes)
self._expectation = Histogram(self.axes)

elif self.norms == self._last_norm_values:
# No changes. Use cache
Expand Down
2 changes: 1 addition & 1 deletion cosipy/data_io/EmCDSUnbinnedData.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def __init__(self,
self._energy, self._scatt_angle, self._scatt_lon, self._scatt_lat = np.broadcast_arrays(energy_keV, scatt_angle_rad, scattered_lon_rad_sc, scattered_lat_rad_sc)

if event_id is None:
self._id = np.arange(self._jd1.size)
self._id = np.arange(self._energy.size)
else:
self._id = np.asarray(event_id)

Expand Down
6 changes: 3 additions & 3 deletions cosipy/data_io/UnBinnedData.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def read_tra(self, input_name=None, output_name=None,
if self.data_file.endswith(".tra.gz"):
# Need to get number of lines for progress bar. First try
# fast method for unix-based systems

try:
proc=subprocess.Popen(f'gunzip -c {self.data_file} | wc -l',
shell=True, stdout=subprocess.PIPE)
Expand All @@ -149,6 +150,7 @@ def read_tra(self, input_name=None, output_name=None,

# If fast method fails, use long method, which should work
# in all cases

except:
logger.info("Initial attempt failed.")
logger.info("Using long method...")
Expand Down Expand Up @@ -188,7 +190,6 @@ def read_tra(self, input_name=None, output_name=None,

this_line = line.lstrip()
match this_line[:2]: # will be "" for empty line

case "SE": # New event marker

# Previous event was read but is not valid.
Expand Down Expand Up @@ -483,7 +484,6 @@ def instrument_pointing(self, ori_file):
self.zl_interp = interpolate.interp1d(time_tags, z_pointings.l.rad, kind='linear')
self.zb_interp = interpolate.interp1d(time_tags, z_pointings.b.rad, kind='linear')


def construct_scy(self, scx_l, scx_b, scz_l, scz_b):

"""Construct y-coordinate of instrument pointing given x and z directions.
Expand Down Expand Up @@ -558,6 +558,7 @@ def cart2polar(self, vector):
Right ascension in radians.
dec : float
Declination in radians.

"""

x, y, z = vector
Expand Down Expand Up @@ -598,7 +599,6 @@ def write_unbinned_output(self, output_name):
for each in self.cosi_dataset.keys():
hf.create_dataset(each, data=self.cosi_dataset[each], compression='gzip')


def get_dict_from_fits(self, input_fits):

"""Constructs dictionary from input fits file.
Expand Down
Loading