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

Fastphotospline #179

Merged
merged 20 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 7 additions & 2 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ v23.2.1
event generation from MC, resulting in a great performance increase when
generating many trials with many events.

- The core.pdf.MultiDimGridPDF class has been adapted to the new Python
interface of photospline that supports numpy arrays. The determination of the
spline table's basis function indices has been separated from the spline table
evaluation which provides an accelerated PDF evaluation.

v23.2.0
=======
- Complete overhaul of SkyLLH for more generic handling of parameters
Expand Down Expand Up @@ -86,7 +91,7 @@ v23.2.0

- core.event_selection.SpatialBoxEventSelectionMethod:

Improved calculation of right-ascention difference. Thus, speed-up in
Improved calculation of right-ascension difference. Thus, speed-up in
trial generation when using this event selection method.

- core.scrambling.DataScrambler.scramble_data method also takes Dataset instance
Expand All @@ -100,7 +105,7 @@ v23.1.1
=======
- bugfix of core.pdf.MultiDimGridPDFSet
- bugfix of core.pdf.MappedMultiDimGridPDFSet
- removal of depricated proptery core.pdf.PDFSet.pdf_axes
- removal of deprecated property core.pdf.PDFSet.pdf_axes

v23.1.0
=======
2 changes: 1 addition & 1 deletion skyllh/core/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1882,7 +1882,7 @@ def calculate_fluxmodel_scaling_factors(
-------
factors : instance of numpy ndarray
The (N_sources,)-shaped numpy ndarray of float holding the factors
the fluxmodels of the sources need to be scaled in order to obtain
the flux models of the sources need to be scaled in order to obtain
the given mean number of signal events in the detector.
"""
src_params_recarray =\
Expand Down
10 changes: 5 additions & 5 deletions skyllh/core/background_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def __init__(
The MC data field names that should be kept in order to be able to
calculate the background events rates by the functions
``get_event_prob_func`` and ``get_mean_func``. All other MC fields
will get droped due to computational efficiency reasons.
will get dropped due to computational efficiency reasons.
pre_event_selection_method : instance of EventSelectionMethod | None
If set to an instance of EventSelectionMethod, this method will
pre-select the MC events that will be used for later background
Expand Down Expand Up @@ -290,7 +290,7 @@ def keep_mc_data_field_names(self):
"""The MC data field names that should be kept in order to be able to
calculate the background events rates by the functions
``get_event_prob_func`` and ``get_mean_func``. All other MC fields
will get droped due to computational efficiency reasons.
will get dropped due to computational efficiency reasons.
"""
return self._keep_mc_data_field_names

Expand Down Expand Up @@ -479,8 +479,8 @@ def generate_events(
else:
mean = float_cast(
mean,
'The mean number of background events must be castable to type '
'float!')
'The mean number of background events must be cast-able to '
'type float!')

# Draw the number of background events from a poisson distribution with
# the given mean number of background events. This will be the number of
Expand All @@ -501,7 +501,7 @@ def generate_events(
n_bkg_selected = int(np.around(n_bkg * mean_pre_selected / mean, 0))

# Draw the actual background events from the selected events of the
# monto-carlo data set.
# monte-carlo data set.
with TaskTimer(tl, 'Draw MC background indices.'):
bkg_event_indices = self._cache_random_choice(
rss=rss,
Expand Down
2 changes: 1 addition & 1 deletion skyllh/core/binning.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def get_bin_indices_from_lower_and_upper_binedges(le, ue, values):

class BinningDefinition(object):
"""The BinningDefinition class provides a structure to hold histogram
binning definitions for an analyis.
binning definitions for an analysis.
"""
def __init__(
self,
Expand Down
4 changes: 2 additions & 2 deletions skyllh/core/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(
name : str
The name of the catalog.
sources : sequence of source_type | None
The sequence of sources this catalog should be initalized with.
The sequence of sources this catalog should be initialized with.
source_type : type | None
The type of the source class. If set to None (default), the
default type defined by SourceCollection will be used.
Expand All @@ -52,7 +52,7 @@ def name(self):
def name(self, name):
name = str_cast(
name,
'The name property must be castable to type str!')
'The name property must be cast-able to type str!')
self._name = name

def __str__(self):
Expand Down
12 changes: 6 additions & 6 deletions skyllh/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
},
'units': {
# Definition of the internal units to use. These must match with the
# units of the monto-carlo data files.
# units of the monte-carlo data files.
'internal': {
'angle': units.radian,
'energy': units.GeV,
Expand Down Expand Up @@ -120,7 +120,7 @@ def from_yaml(
Parameters
----------
pathfilename: str | None
Path and filename to the yaml file containg the to-be-updated
Path and filename to the yaml file containing the to-be-updated
configuration items.
If set to ``None``, nothing is done.

Expand Down Expand Up @@ -156,7 +156,7 @@ def from_dict(
Parameters
----------
user_dict: dict
The dictionary containg the to-be-updated configuration items.
The dictionary containing the to-be-updated configuration items.

Returns
-------
Expand Down Expand Up @@ -207,13 +207,13 @@ def enable_tracing(
def get_wd(
self,
):
"""Retrieves the absolut path to the working directoy as configured in
"""Retrieves the absolute path to the working directory as configured in
this configuration.

Returns
-------
wd : str
The absolut path to the project's working directory.
The absolute path to the project's working directory.
"""
wd = os.path.abspath(self['project']['working_directory'])

Expand Down Expand Up @@ -342,7 +342,7 @@ def set_wd(
Returns
-------
wd : str
The absolut path to the project's working directory.
The absolute path to the project's working directory.
"""
if path is None:
path = self['project']['working_directory']
Expand Down
2 changes: 1 addition & 1 deletion skyllh/core/datafields.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def get_joint_names(
Parameters
----------
datafields : dict
The dictionary of datafield names as keys and stages as values.
The dictionary of data field names as keys and stages as values.
stages : int | sequence of int
The stage(s) for which data field names should get returned.

Expand Down
Loading