ananke.configurations package

Subpackages

Submodules

ananke.configurations.collection module

Module for all the configuration models of the collection.

class ananke.configurations.collection.MergeContentConfiguration(*, primary_type: RecordType, number_of_records: Optional[PositiveInt] = None, secondary_types: Optional[List[RecordType]] = None, interval: Optional[Interval] = None, filter_no_hits: bool = True)[source]

Bases: BaseModel

Configuration saying what should be in one.

It first tries to collect the number of records of the primary type. Then it mixes in the secondary types. Each type must at least have the number of types available.

primary_type: RecordType

Types to keep and search for

number_of_records: Optional[PositiveInt]

Number of records

secondary_types: Optional[List[RecordType]]

Types to mix in

interval: Optional[Interval]

Interval of hits

filter_no_hits: bool

Should empty hit records be filtered?

class ananke.configurations.collection.StorageTypes(value)[source]

Bases: str, Enum

Types of storage configurations.

HDF5 = 'hdf5'
MEMORY = 'memory'
class ananke.configurations.collection.StorageConfiguration(*, type: str, read_only: bool = True, batch_size: PositiveInt = 100)[source]

Bases: BaseModel

Base configuration for all collection storages.

type: str
read_only: bool
batch_size: PositiveInt
class ananke.configurations.collection.MemoryStorageConfiguration(*, type: ~typing.Literal[<StorageTypes.MEMORY: 'memory'>] = StorageTypes.MEMORY, read_only: bool = True, batch_size: ~pydantic.types.PositiveInt = 100)[source]

Bases: StorageConfiguration

Configuration for collection storage in memory.

type: MEMORY: 'memory'>]
ananke.configurations.collection.ComplibConstraintType_

alias of ConstrainedStrValue

class ananke.configurations.collection.HDF5StorageConfiguration(*, type: ~typing.Literal[<StorageTypes.HDF5: 'hdf5'>] = StorageTypes.HDF5, read_only: bool = True, batch_size: ~pydantic.types.PositiveInt = 100, data_path: str, complevel: ~ananke.configurations.collection.ConstrainedIntValue = 3, complib: ~ananke.configurations.collection.ConstrainedStrValue = 'lzo', optlevel: ~ananke.configurations.collection.ConstrainedIntValue = 6)[source]

Bases: StorageConfiguration

Configuration for hdf5 collection storage.

type: HDF5: 'hdf5'>]
data_path: str

Path of the HDF5 file

complevel: ConstrainedIntValue

Compression level; See documentation of pd.to_hdf

complib: ConstrainedStrValue

Compression library; See documentation of pd.to_hdf

optlevel: ConstrainedIntValue

Index optimization level

class ananke.configurations.collection.ExportConfiguration[source]

Bases: BaseModel

Base configuration for all exports.

class ananke.configurations.collection.GraphNetExportConfiguration(*, data_path: str, batch_size: PositiveInt = 100)[source]

Bases: ExportConfiguration

Configuration for GraphNetExports.

data_path: str
batch_size: PositiveInt
class ananke.configurations.collection.MergeConfiguration(*, in_collections: List[Union[HDF5StorageConfiguration, MemoryStorageConfiguration]], tmp_collection: Union[HDF5StorageConfiguration, MemoryStorageConfiguration] = None, out_collection: Union[HDF5StorageConfiguration, MemoryStorageConfiguration], content: Optional[List[MergeContentConfiguration]] = None, redistribution: Optional[RedistributionConfiguration] = None, seed: int = 32118)[source]

Bases: BaseModel

Configuration to merge multiple collections into one.

in_collections: List[Union[HDF5StorageConfiguration, MemoryStorageConfiguration]]
tmp_collection: Union[HDF5StorageConfiguration, MemoryStorageConfiguration]
out_collection: Union[HDF5StorageConfiguration, MemoryStorageConfiguration]
content: Optional[List[MergeContentConfiguration]]
redistribution: Optional[RedistributionConfiguration]
seed: int

ananke.configurations.detector module

Module containing all configurations for a detector.

class ananke.configurations.detector.DetectorGeometries(value)[source]

Bases: str, Enum

Possible detector geometries.

SINGLE = 'single'

Detector of only a single string.

TRIANGULAR = 'triangular'

Detector with three triangular strings.

GRID = 'grid'

detector with a given number of grid located strings.

HEXAGONAL = 'hexagonal'

detector with a given number of hexagonal located strings.

RHOMBUS = 'rhombus'

Detector of four square strings

class ananke.configurations.detector.Position(*, x: float, y: float)[source]

Bases: BaseModel

Configuration for a position.

x: float

X-position of the position.

y: float

Y-position of the position.

class ananke.configurations.detector.GeometryConfiguration(*, start_position: Position = Position(x=0.0, y=0.0), type: str)[source]

Bases: BaseModel

Configuration for a detector geometry.

start_position: Position

Start position of the current geometry

type: str

type of the configuration

class ananke.configurations.detector.SingleGeometryConfiguration(*, start_position: ~ananke.configurations.detector.Position = Position(x=0.0, y=0.0), type: ~typing.Literal[<DetectorGeometries.SINGLE: 'single'>])[source]

Bases: GeometryConfiguration

Configuration for a single string geometry.

type: SINGLE: 'single'>]

Type of the expected detector geometry

class ananke.configurations.detector.LengthGeometryConfiguration(*, start_position: ~ananke.configurations.detector.Position = Position(x=0.0, y=0.0), type: ~typing.Literal[<DetectorGeometries.TRIANGULAR: 'triangular'>, <DetectorGeometries.RHOMBUS: 'rhombus'>], side_length: ~pydantic.types.PositiveInt)[source]

Bases: GeometryConfiguration

Configuration for a length based geometry.

Examples for this could be squares or triangles.

type: RHOMBUS: 'rhombus'>]

types for LengthGeometryConfiguration

side_length: PositiveInt

side length of the detector

class ananke.configurations.detector.SidedGeometryConfiguration(*, start_position: ~ananke.configurations.detector.Position = Position(x=0.0, y=0.0), type: ~typing.Literal[<DetectorGeometries.GRID: 'grid'>, <DetectorGeometries.HEXAGONAL: 'hexagonal'>], number_of_strings_per_side: ~pydantic.types.PositiveInt, distance_between_strings: ~pydantic.types.NonNegativeFloat)[source]

Bases: GeometryConfiguration

Configuration for geometries with multiple sides.

Examples are grids and hexagonal architectures.

type: HEXAGONAL: 'hexagonal'>]

types for SidedGeometryConfiguration

number_of_strings_per_side: PositiveInt

Amounts for the number of modules per side

distance_between_strings: NonNegativeFloat

Distance between the individual strings

class ananke.configurations.detector.PMTConfiguration(*, efficiency: ConstrainedFloatValue = 0.5, area: NonNegativeFloat = 0.0375, noise_rate: NonNegativeFloat = 0.00016, gamma_scale: NonNegativeFloat = 0.0)[source]

Bases: BaseModel

Configuration for a single PMT.

efficiency: ConstrainedFloatValue

Efficiency of the PMT

area: NonNegativeFloat

Area of the PMT opening [m^2]

noise_rate: NonNegativeFloat

Base Noise rate for the detector [1/ns]

gamma_scale: NonNegativeFloat

Scale of gamma distribution for noise rate. If 0.0, the fixed value is taken

class ananke.configurations.detector.ModuleConfiguration(*, radius: PositiveFloat, module_as_PMT: bool = False)[source]

Bases: BaseModel

Configuration for a single Module.

radius: PositiveFloat

radius of a given module

module_as_PMT: bool

whether to stop at the module level or not

class ananke.configurations.detector.StringConfiguration(*, z_offset: float = 0.0, module_number: PositiveInt, module_distance: PositiveFloat)[source]

Bases: BaseModel

Configuration for a single string.

z_offset: float

The distance of the first module to the flow

module_number: PositiveInt

Number of modules on the string

module_distance: PositiveFloat

Distance between individual modules

class ananke.configurations.detector.DetectorConfiguration(*, geometry: Union[LengthGeometryConfiguration, SidedGeometryConfiguration, SingleGeometryConfiguration], string: StringConfiguration, module: ModuleConfiguration, pmt: PMTConfiguration, seed: int = 32118)[source]

Bases: BaseModel

Configuration for the detector builder to build detector.

geometry: Union[LengthGeometryConfiguration, SidedGeometryConfiguration, SingleGeometryConfiguration]

Settings regarding the shape of the final detector

string: StringConfiguration

Configuration for the individual string

module: ModuleConfiguration

Configuration for the individual module

pmt: PMTConfiguration

Configuration for the individual PMT

seed: int

Seed for the random generators used within detector

ananke.configurations.events module

Module containing all the configuration definitions for events.

class ananke.configurations.events.EventRedistributionMode(value)[source]

Bases: str, Enum

Enum for all the different redistribution modes.

START_TIME = 'start_time'
CONTAINS_HIT = 'contains_hit'
CONTAINS_EVENT = 'contains_event'
CONTAINS_PERCENTAGE = 'contains_percentage'
class ananke.configurations.events.Interval(*, start: float = 0, end: float = 1000)[source]

Bases: BaseModel

Class defining a basic interval [start, end).

start: float

Start time of the interval (>=).

end: float

End time of the interval (<).

property range: Tuple[float, float]

Tuple containing the interval range.

property length: float

Represents length of the interval.

is_between(value: float) bool[source]

Tells you whether your value is between or outside.

Parameters:

value – Value to check

Returns: Boolean containing whether value is between start and end.

class ananke.configurations.events.HistogramConfiguration(*, start: float = 0, end: float = 1000, bin_size: float = 10)[source]

Bases: Interval

Subclass of Interval adding tht bin size to configure a histogram.

bin_size: float
property number_of_bins: int

Calculate how many bins are between start and end.

Returns:

number of bins

class ananke.configurations.events.RedistributionConfiguration(*, interval: Interval, mode: EventRedistributionMode, seed: int = 32118, percentile: float = 0.5)[source]

Bases: BaseModel

Config to make redistribution standardized.

interval: Interval

Interval in which to redistribute

mode: EventRedistributionMode

Mode by which to redistribute

seed: int

Seed for redistribution

percentile: float

Percentile of hits in interval

Module contents

Package containing all configuration schemas for the ananke ecosystem.