threeML / hawc_hal

HAWC Accelerated Likelihood - python-only framework for HAWC data analysis
BSD 3-Clause "New" or "Revised" License
11 stars 22 forks source link

Dictionary based maptree and response objects #4

Closed colasri closed 6 years ago

colasri commented 6 years ago

Refactor the maptree and response objects using (ordered) dictionaries.

Before, the objects contained 2 lists: the bin name and the bin data. These 2 lists needed to be synchronized within the object, and the maptree and response object had to be synchronized too. The active_planes (bins to used) were using the (necessarily common) indices of the bins in these lists.

Now, the objects contain one dictionary. The synchronization within an object is automatic. The maptree and response objects do not need to be synchronized. The active_planes is a list of keys. The keys of the active_planes still need to appear in both maptree and response objects, obviously.

colasri commented 6 years ago

Not to be merged yet, I still want to do some tests. And I wonder if I broke the get_simulated_dataset() method.

codecov[bot] commented 6 years ago

Codecov Report

Merging #4 into master will decrease coverage by 0.28%. The diff coverage is 90.17%.

@@            Coverage Diff             @@
##           master       #4      +/-   ##
==========================================
- Coverage   93.47%   93.19%   -0.29%     
==========================================
  Files          38       38              
  Lines        1441     1454      +13     
==========================================
+ Hits         1347     1355       +8     
- Misses         94       99       +5
colasri commented 6 years ago

It looks like get_simulated_dataset() was covered by the tests, so I think it's ready for merging.