hawc_hal.region_of_interest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 6
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A get_roi_from_dict() 0 11 1
1
from hawc_hal.region_of_interest.healpix_cone_roi import HealpixConeROI, HealpixROIBase
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
2
from hawc_hal.region_of_interest.healpix_map_roi import HealpixMapROI
3
4
5
def get_roi_from_dict(dictionary):
6
    """
7
    Make a ROI from a dictionary such as the one read from the hd5 file of the maptree.
8
9
    :param dictionary:
10
    :return:
11
    """
12
13
    roi_type = dictionary['ROI type']
14
15
    return globals()[roi_type].from_dict(dictionary)
16