Investigation#
- class cegalprizm.investigator.Investigation(context: cegalprizm.investigator.hub_context.InvPyHubContext, path: Optional[str] = None, investigation_id: Optional[str] = None)#
A class representing a Blueback Investigation
The investigation object forms the entry point for all API access to a specific investigation.
Functions
__init__
(context[, path, investigation_id])as_dataframe
([dataset_name, ...])A dataframe of all the points with both continuous and discrete dimensions
create_borehole_intersections
(grid_names)Force creation of the borehole intersection datasets for the defined grid names.
create_classifier
(name, func, inputs, output)Create a new classification equation in the investigation
create_map_intersections
(grid_names)Force creation of the map intersection datasets for the defined grid names.
create_predictor
(name, func, inputs, output)Create a new prediction equation in the investigation
get_continuous_settings
(name)Gets the continuous dimension settings for the specified dimension name
get_dataset_settings
(name)Gets the settings for the specified dataset name
get_discrete_settings
(name)Gets the discrete dimension settings for the specified dimension name
refresh
()Refresh the investigation object
update
()Update the investigation with any recent changes
Properties
The available units for each continuous dimension
The names of the continuous dimensions
A list of containing a tuple of continuous dimension name and the property name
The names of the datasets
The names of the discrete dimensions
A list of containing a tuple of discrete dimension name and the property name
Returns a dictionary containing each discrete dimension name as a key and a list of the "tags" as the values
The display units for each continuous dimension
The names of any filters
The identifier of this investigation
The invariant units for each continuous dimension
Is the investigation valid
The name of this investigation
The number of continuous dimensions
The number of discrete dimensions
A list of the plot types in which this investigation can be shown
- as_dataframe(dataset_name: Optional[str] = None, continuous_columns: Union[str, Sequence[str]] = 'all', continuous_units: str = 'display', discrete_columns: Union[str, Sequence[str]] = 'all', discrete_data_as: str = 'string', include_filters: Union[str, Sequence[str]] = 'all') pandas.core.frame.DataFrame #
A dataframe of all the points with both continuous and discrete dimensions
- Parameters
dataset_name (str, optional) – The name of the dataset being output to the dataframe. Defaults to None.
continuous_columns (Union[str, Sequence[str]], optional) – Defaults to ‘all’. - ‘all’ will include all continuous dimensions from the investigation - a list of continuous dimension names that should be included (see Investigation.continuous_dimension_names property) - None which will include no continuous dimensions in the dataframe
continuous_units (str, optional) – Defaults to ‘display’. - ‘display’ will result in continuous values in invariant units - ‘invariant’ will result in continuous values in invariant units - a dictionary of continuous dimension names: a unit string (see Investigation.available_units property)
discrete_columns (Union[str, Sequence[str]], optional) – Defaults to ‘all’. - ‘all’ will include all discrete dimensions from the investigation - a list of discrete dimension names that should be included (see Investigation.discrete_dimension_names property) - None which will include no discrete dimensions in the dataframe
discrete_data_as (str, optional) – Defaults to ‘string’. - ‘string’ will cause discrete data tag to be returned as name - ‘value’ will cause discrete data tag to be returned as int
include_filters (Union[str, Sequence[str]], optional) – Defaults to ‘all’. - ‘all’ will include all filters as boolean columns in the dataframe - a list of filter names that should be included (see Investigation.filter_names property) - None which will include no filter columns in the dataframe
- Raises
CegalHubError – if an unexpected error is reported by Hub
- Returns
A dataframe
- Return type
pandas.DataFrame
- create_borehole_intersections(grid_names: Sequence[str])#
Force creation of the borehole intersection datasets for the defined grid names.
- Parameters
grid_names (Sequence[str]) – The names of the grids to be used
- create_classifier(name: str, func: Callable, inputs: Sequence[cegalprizm.investigator.named_tuples.ContinuousPropertyTuple], output: cegalprizm.investigator.named_tuples.DiscretePropertyTuple)#
Create a new classification equation in the investigation
A new python classification equation will be created in the investigation. Classifications will be made by invoking the provided func.
- Parameters
name (str) – The name of the classification to be used
func (Callable) – The function that performs the classification
inputs (Sequence[ContinuousPropertyTuple]) – a list of tuples each containing a continuous dimension name and a unit string
output (DiscretePropertyTuple) – a tuple of discrete name and a list of discrete tags
- Raises
CegalHubError – if an unexpected error is reported by Hub
ValueError – if any of the inputs are not valid
- create_map_intersections(grid_names: Sequence[str])#
Force creation of the map intersection datasets for the defined grid names.
- Parameters
grid_names (Sequence[str]) – The names of the grids to be used
- create_predictor(name: str, func: Callable, inputs: Sequence[cegalprizm.investigator.named_tuples.ContinuousPropertyTuple], output: cegalprizm.investigator.named_tuples.ContinuousPropertyTuple)#
Create a new prediction equation in the investigation
A new python prediction equation will be created in the investigation. Predictions will be made by invoking the provided func.
- Parameters
name (str) – The name of the prediction to be used
func (Callable) – The function that performs the prediction
inputs (Sequence[ContinuousPropertyTuple]) – a list of tuples each containing a continuous dimension name and a unit string
output (ContinuousPropertyTuple) – a tuple of continuous dimension name and a unit string
- Raises
CegalHubError – if an unexpected error is reported by Hub
ValueError – if any of the inputs are not valid
- get_continuous_settings(name: str) cegalprizm.investigator.inv.continuous_dimension.ContinuousDimension #
Gets the continuous dimension settings for the specified dimension name
- Parameters
name (str) – The name of the continuous dimension to be used
- Raises
ValueError – if the name is not a valid continuous dimension
- Returns
The continuous dimension object
- Return type
ContinuousDimension
- get_dataset_settings(name: str) cegalprizm.investigator.inv.dataset.Dataset #
Gets the settings for the specified dataset name
- Parameters
name (str) – The name of the dataset to be used
- Raises
ValueError – if the name is not a valid dataset
- Returns
The dataset object
- Return type
Dataset
- get_discrete_settings(name: str) cegalprizm.investigator.inv.discrete_dimension.DiscreteDimension #
Gets the discrete dimension settings for the specified dimension name
- Parameters
name (str) – The name of the discrete dimension to be used
- Raises
ValueError – if the name is not a valid discrete dimension
- Returns
The discrete discrete object
- Return type
DiscreteDimension
- refresh()#
Refresh the investigation object
This will fetch any changes made remotely to the investigation. It will override any local changes continuous/discrete dimensions or dataset settings that have not been applied by calling :func:update() method
- Raises
CegalHubError – if an unexpected error is reported by Hub
- update()#
Update the investigation with any recent changes
Apply any recent changes to continuous/discrete dimensions or dataset settings to the investigation and therefore these changes will be visible when creating new plots etc
- Raises
CegalHubError – if an unexpected error is reported by Hub
- property available_units: Dict[str, List[str]]#
The available units for each continuous dimension
- Returns
a list of valid unit symbols for each continuous dimension name
- Return type
Dict[str, list[str]]
- property continuous_dimension_names: List[str]#
The names of the continuous dimensions
- Returns
the names of the continuous dimensions
- Return type
list[str]
- property continuous_dimension_property_names: List[cegalprizm.investigator.named_tuples.DimensionPropertyNameTuple]#
A list of containing a tuple of continuous dimension name and the property name
- Returns
A list of tuples containing the dimension name and property name for each continuous dimension
- Return type
List[Tuple[str, str]]
- property dataset_names: List[str]#
The names of the datasets
- Returns
the names of the datasets
- Return type
list[str]
- property discrete_dimension_names: List[str]#
The names of the discrete dimensions
- Returns
the names of the discrete dimensions
- Return type
list[str]
- property discrete_dimension_property_names: List[cegalprizm.investigator.named_tuples.DimensionPropertyNameTuple]#
A list of containing a tuple of discrete dimension name and the property name
- Returns
A list of tuples containing the dimension name and property name for each discrete dimension
- Return type
List[Tuple[str, str]]
- property discrete_dimension_tags: Dict[str, List[str]]#
Returns a dictionary containing each discrete dimension name as a key and a list of the “tags” as the values
- Returns
A dictionary of dimension names and tags
- Return type
Dict[str, List[str]]
- property display_units: Dict[str, str]#
The display units for each continuous dimension
- Returns
the display unit symbol for each continuous dimension name
- Return type
Dict[str, str]
- property filter_names: List[str]#
The names of any filters
- Returns
the names of any filters
- Return type
list[str]
- property id: str#
The identifier of this investigation
- Returns
The investigation identifier
- Return type
str
- property invariant_units: Dict[str, str]#
The invariant units for each continuous dimension
- Returns
the invariant unit symbol for each continuous dimension name
- Return type
Dict[str, str]
- property is_valid: bool#
Is the investigation valid
- Returns
The investigation validity
- Return type
bool
- property name: str#
The name of this investigation
- Returns
The investigation name
- Return type
str
- property num_continuous_dimensions: int#
The number of continuous dimensions
- Returns
The number of continuous dimensions
- Return type
int
- property num_discrete_dimensions: int#
The number of discrete dimensions
- Returns
The number of discrete dimensions
- Return type
int
- property supported_plots: List[str]#
A list of the plot types in which this investigation can be shown
- Returns
A list of strings describing the plot types in which this investigation can be shown
- Return type
List[str]