INSTRUCTION stringlengths 1 8.43k | RESPONSE stringlengths 75 104k |
|---|---|
Writes data to grib2 file. Currently grib codes are set by hand to hail. | def write_grib2(self, path):
"""
Writes data to grib2 file. Currently, grib codes are set by hand to hail.
Args:
path: Path to directory containing grib2 files.
Returns:
"""
if self.percentile is None:
var_type = "mean"
else:
... |
Initializes netCDF file for writing | def init_file(self, filename, time_units="seconds since 1970-01-01T00:00"):
"""
Initializes netCDF file for writing
Args:
filename: Name of the netCDF file
time_units: Units for the time variable in format "<time> since <date string>"
Returns:
Dataset... |
Outputs data to a netCDF file. If the file does not exist it will be created. Otherwise additional variables are appended to the current file | def write_to_file(self, out_data):
"""
Outputs data to a netCDF file. If the file does not exist, it will be created. Otherwise, additional variables
are appended to the current file
Args:
out_data: Full-path and name of output netCDF file
"""
full_var_name =... |
Restore the workspace to the given workspace_uuid. | def restore(self, workspace_uuid):
"""
Restore the workspace to the given workspace_uuid.
If workspace_uuid is None then create a new workspace and use it.
"""
workspace = next((workspace for workspace in self.document_model.workspaces if workspace.uuid == workspace_uuid... |
Create a new workspace insert into document_model and return it. | def new_workspace(self, name=None, layout=None, workspace_id=None, index=None) -> WorkspaceLayout.WorkspaceLayout:
""" Create a new workspace, insert into document_model, and return it. """
workspace = WorkspaceLayout.WorkspaceLayout()
self.document_model.insert_workspace(index if index is not N... |
Looks for a workspace with workspace_id. | def ensure_workspace(self, name, layout, workspace_id):
"""Looks for a workspace with workspace_id.
If none is found, create a new one, add it, and change to it.
"""
workspace = next((workspace for workspace in self.document_model.workspaces if workspace.workspace_id == workspace_id), N... |
Pose a dialog to name and create a workspace. | def create_workspace(self) -> None:
""" Pose a dialog to name and create a workspace. """
def create_clicked(text):
if text:
command = Workspace.CreateWorkspaceCommand(self, text)
command.perform()
self.document_controller.push_undo_command(co... |
Pose a dialog to rename the workspace. | def rename_workspace(self) -> None:
""" Pose a dialog to rename the workspace. """
def rename_clicked(text):
if len(text) > 0:
command = Workspace.RenameWorkspaceCommand(self, text)
command.perform()
self.document_controller.push_undo_command(... |
Pose a dialog to confirm removal then remove workspace. | def remove_workspace(self):
""" Pose a dialog to confirm removal then remove workspace. """
def confirm_clicked():
if len(self.document_model.workspaces) > 1:
command = Workspace.RemoveWorkspaceCommand(self)
command.perform()
self.document_con... |
Pose a dialog to name and clone a workspace. | def clone_workspace(self) -> None:
""" Pose a dialog to name and clone a workspace. """
def clone_clicked(text):
if text:
command = Workspace.CloneWorkspaceCommand(self, text)
command.perform()
self.document_controller.push_undo_command(comman... |
Used in drag/ drop support. | def __replace_displayed_display_item(self, display_panel, display_item, d=None) -> Undo.UndoableCommand:
""" Used in drag/drop support. """
self.document_controller.replaced_display_panel_content = display_panel.save_contents()
command = DisplayPanel.ReplaceDisplayPanelCommand(self)
if d... |
Given a set of DistributedROC or DistributedReliability objects this function performs a bootstrap resampling of the objects and returns n_boot aggregations of them. | def bootstrap(score_objs, n_boot=1000):
"""
Given a set of DistributedROC or DistributedReliability objects, this function performs a
bootstrap resampling of the objects and returns n_boot aggregations of them.
Args:
score_objs: A list of DistributedROC or DistributedReliability objects. Object... |
Update the ROC curve with a set of forecasts and observations | def update(self, forecasts, observations):
"""
Update the ROC curve with a set of forecasts and observations
Args:
forecasts: 1D array of forecast values
observations: 1D array of observation values.
"""
for t, threshold in enumerate(self.thresholds):
... |
Ingest the values of another DistributedROC object into this one and update the statistics inplace. | def merge(self, other_roc):
"""
Ingest the values of another DistributedROC object into this one and update the statistics inplace.
Args:
other_roc: another DistributedROC object.
"""
if other_roc.thresholds.size == self.thresholds.size and np.all(other_roc.threshold... |
Generate a ROC curve from the contingency table by calculating the probability of detection ( TP/ ( TP + FN )) and the probability of false detection ( FP/ ( FP + TN )). | def roc_curve(self):
"""
Generate a ROC curve from the contingency table by calculating the probability of detection (TP/(TP+FN)) and the
probability of false detection (FP/(FP+TN)).
Returns:
A pandas.DataFrame containing the POD, POFD, and the corresponding probability thre... |
Calculate the Probability of Detection and False Alarm Ratio in order to output a performance diagram. | def performance_curve(self):
"""
Calculate the Probability of Detection and False Alarm Ratio in order to output a performance diagram.
Returns:
pandas.DataFrame containing POD, FAR, and probability thresholds.
"""
pod = self.contingency_tables["TP"] / (self.continge... |
Calculate the Area Under the ROC Curve ( AUC ). | def auc(self):
"""
Calculate the Area Under the ROC Curve (AUC).
"""
roc_curve = self.roc_curve()
return np.abs(np.trapz(roc_curve['POD'], x=roc_curve['POFD'])) |
Calculate the maximum Critical Success Index across all probability thresholds | def max_csi(self):
"""
Calculate the maximum Critical Success Index across all probability thresholds
Returns:
The maximum CSI as a float
"""
csi = self.contingency_tables["TP"] / (self.contingency_tables["TP"] + self.contingency_tables["FN"] +
... |
Create an Array of ContingencyTable objects for each probability threshold. | def get_contingency_tables(self):
"""
Create an Array of ContingencyTable objects for each probability threshold.
Returns:
Array of ContingencyTable objects
"""
return np.array([ContingencyTable(*ct) for ct in self.contingency_tables.values]) |
Read the DistributedROC string and parse the contingency table values from it. | def from_str(self, in_str):
"""
Read the DistributedROC string and parse the contingency table values from it.
Args:
in_str (str): The string output from the __str__ method
"""
parts = in_str.split(";")
for part in parts:
var_name, value = part.sp... |
Update the statistics with a set of forecasts and observations. | def update(self, forecasts, observations):
"""
Update the statistics with a set of forecasts and observations.
Args:
forecasts (numpy.ndarray): Array of forecast probability values
observations (numpy.ndarray): Array of observation values
"""
for t, thres... |
Ingest another DistributedReliability and add its contents to the current object. | def merge(self, other_rel):
"""
Ingest another DistributedReliability and add its contents to the current object.
Args:
other_rel: a Distributed reliability object.
"""
if other_rel.thresholds.size == self.thresholds.size and np.all(other_rel.thresholds == self.thres... |
Calculates the reliability diagram statistics. The key columns are Bin_Start and Positive_Relative_Freq | def reliability_curve(self):
"""
Calculates the reliability diagram statistics. The key columns are Bin_Start and Positive_Relative_Freq
Returns:
pandas.DataFrame
"""
total = self.frequencies["Total_Freq"].sum()
curve = pd.DataFrame(columns=["Bin_Start", "Bin... |
Calculate the components of the Brier score decomposition: reliability resolution and uncertainty. | def brier_score_components(self):
"""
Calculate the components of the Brier score decomposition: reliability, resolution, and uncertainty.
"""
rel_curve = self.reliability_curve()
total = self.frequencies["Total_Freq"].sum()
climo_freq = float(self.frequencies["Positive_F... |
Calculate the Brier Score | def brier_score(self):
"""
Calculate the Brier Score
"""
reliability, resolution, uncertainty = self.brier_score_components()
return reliability - resolution + uncertainty |
Calculate the Brier Skill Score | def brier_skill_score(self):
"""
Calculate the Brier Skill Score
"""
reliability, resolution, uncertainty = self.brier_score_components()
return (resolution - reliability) / uncertainty |
Update the statistics with forecasts and observations. | def update(self, forecasts, observations):
"""
Update the statistics with forecasts and observations.
Args:
forecasts: The discrete Cumulative Distribution Functions of
observations:
"""
if len(observations.shape) == 1:
obs_cdfs = np.zeros((ob... |
Calculates the continuous ranked probability score. | def crps(self):
"""
Calculates the continuous ranked probability score.
"""
return np.sum(self.errors["F_2"].values - self.errors["F_O"].values * 2.0 + self.errors["O_2"].values) / \
(self.thresholds.size * self.num_forecasts) |
Calculate the climatological CRPS. | def crps_climo(self):
"""
Calculate the climatological CRPS.
"""
o_bar = self.errors["O"].values / float(self.num_forecasts)
crps_c = np.sum(self.num_forecasts * (o_bar ** 2) - o_bar * self.errors["O"].values * 2.0 +
self.errors["O_2"].values) / float(self... |
Calculate the continous ranked probability skill score from existing data. | def crpss(self):
"""
Calculate the continous ranked probability skill score from existing data.
"""
crps_f = self.crps()
crps_c = self.crps_climo()
return 1.0 - float(crps_f) / float(crps_c) |
Checa em sequência os alertas registrados ( veja: func: registrar ) contra os dados da consulta ao status operacional do equipamento SAT. Este método irá então resultar em uma lista dos alertas ativos. | def checar(cliente_sat):
"""
Checa em sequência os alertas registrados (veja :func:`registrar`) contra os
dados da consulta ao status operacional do equipamento SAT. Este método irá
então resultar em uma lista dos alertas ativos.
:param cliente_sat: Uma instância de
:class:`satcfe.clientelo... |
Return whether the metadata value for the given key exists. | def has_metadata_value(metadata_source, key: str) -> bool:
"""Return whether the metadata value for the given key exists.
There are a set of predefined keys that, when used, will be type checked and be interoperable with other
applications. Please consult reference documentation for valid keys.
If usi... |
Get the metadata value for the given key. | def get_metadata_value(metadata_source, key: str) -> typing.Any:
"""Get the metadata value for the given key.
There are a set of predefined keys that, when used, will be type checked and be interoperable with other
applications. Please consult reference documentation for valid keys.
If using a custom ... |
Set the metadata value for the given key. | def set_metadata_value(metadata_source, key: str, value: typing.Any) -> None:
"""Set the metadata value for the given key.
There are a set of predefined keys that, when used, will be type checked and be interoperable with other
applications. Please consult reference documentation for valid keys.
If us... |
Delete the metadata value for the given key. | def delete_metadata_value(metadata_source, key: str) -> None:
"""Delete the metadata value for the given key.
There are a set of predefined keys that, when used, will be type checked and be interoperable with other
applications. Please consult reference documentation for valid keys.
If using a custom ... |
Calculate the y - axis items dependent on the plot height. | def calculate_y_ticks(self, plot_height):
"""Calculate the y-axis items dependent on the plot height."""
calibrated_data_min = self.calibrated_data_min
calibrated_data_max = self.calibrated_data_max
calibrated_data_range = calibrated_data_max - calibrated_data_min
ticker = self... |
Calculate the x - axis items dependent on the plot width. | def calculate_x_ticks(self, plot_width):
"""Calculate the x-axis items dependent on the plot width."""
x_calibration = self.x_calibration
uncalibrated_data_left = self.__uncalibrated_left_channel
uncalibrated_data_right = self.__uncalibrated_right_channel
calibrated_data_left ... |
Size the canvas item to the proper height. | def size_to_content(self):
""" Size the canvas item to the proper height. """
new_sizing = self.copy_sizing()
new_sizing.minimum_height = 0
new_sizing.maximum_height = 0
axes = self.__axes
if axes and axes.is_valid:
if axes.x_calibration and axes.x_calibration... |
Size the canvas item to the proper width the maximum of any label. | def size_to_content(self, get_font_metrics_fn):
""" Size the canvas item to the proper width, the maximum of any label. """
new_sizing = self.copy_sizing()
new_sizing.minimum_width = 0
new_sizing.maximum_width = 0
axes = self.__axes
if axes and axes.is_valid:
... |
Size the canvas item to the proper width. | def size_to_content(self):
""" Size the canvas item to the proper width. """
new_sizing = self.copy_sizing()
new_sizing.minimum_width = 0
new_sizing.maximum_width = 0
axes = self.__axes
if axes and axes.is_valid:
if axes.y_calibration and axes.y_calibration.un... |
Load the content from a snippet file which exists in SNIPPETS_ROOT | def get_snippet_content(snippet_name, **format_kwargs):
""" Load the content from a snippet file which exists in SNIPPETS_ROOT """
filename = snippet_name + '.snippet'
snippet_file = os.path.join(SNIPPETS_ROOT, filename)
if not os.path.isfile(snippet_file):
raise ValueError('could not find snipp... |
Update the display values. Called from display panel. | def update_display_properties(self, display_calibration_info, display_properties: typing.Mapping, display_layers: typing.Sequence[typing.Mapping]) -> None:
"""Update the display values. Called from display panel.
This method saves the display values and data and triggers an update. It should be as fast... |
Change the view to encompass the channels and data represented by the given intervals. | def __view_to_intervals(self, data_and_metadata: DataAndMetadata.DataAndMetadata, intervals: typing.List[typing.Tuple[float, float]]) -> None:
"""Change the view to encompass the channels and data represented by the given intervals."""
left = None
right = None
for interval in intervals:
... |
Change the view to encompass the selected graphic intervals. | def __view_to_selected_graphics(self, data_and_metadata: DataAndMetadata.DataAndMetadata) -> None:
"""Change the view to encompass the selected graphic intervals."""
all_graphics = self.__graphics
graphics = [graphic for graphic_index, graphic in enumerate(all_graphics) if self.__graphic_selecti... |
Prepare the display. | def prepare_display(self):
"""Prepare the display.
This method gets called by the canvas layout/draw engine after being triggered by a call to `update`.
When data or display parameters change, the internal state of the line plot gets updated. This method takes
that internal state and u... |
Map the mouse to the 1 - d position within the line graph. | def __update_cursor_info(self):
""" Map the mouse to the 1-d position within the line graph. """
if not self.delegate: # allow display to work without delegate
return
if self.__mouse_in and self.__last_mouse:
pos_1d = None
axes = self.__axes
lin... |
Identify storms in gridded model output and extract uniform sized patches around the storm centers of mass. | def find_model_patch_tracks(self):
"""
Identify storms in gridded model output and extract uniform sized patches around the storm centers of mass.
Returns:
"""
self.model_grid.load_data()
tracked_model_objects = []
model_objects = []
if self.model_grid.d... |
Identify storms at each model time step and link them together with object matching. | def find_model_tracks(self):
"""
Identify storms at each model time step and link them together with object matching.
Returns:
List of STObjects containing model track information.
"""
self.model_grid.load_data()
model_objects = []
tracked_model_objec... |
Identify objects from MRMS timesteps and link them together with object matching. | def find_mrms_tracks(self):
"""
Identify objects from MRMS timesteps and link them together with object matching.
Returns:
List of STObjects containing MESH track information.
"""
obs_objects = []
tracked_obs_objects = []
if self.mrms_ew is not None:
... |
Match forecast and observed tracks. | def match_tracks(self, model_tracks, obs_tracks, unique_matches=True, closest_matches=False):
"""
Match forecast and observed tracks.
Args:
model_tracks:
obs_tracks:
unique_matches:
closest_matches:
Returns:
"""
if unique... |
Extract model attribute data for each model track. Storm variables are those that describe the model storm directly such as radar reflectivity or updraft helicity. Potential variables describe the surrounding environmental conditions of the storm and should be extracted from the timestep before the storm arrives to red... | def extract_model_attributes(self, tracked_model_objects, storm_variables, potential_variables,
tendency_variables=None, future_variables=None):
"""
Extract model attribute data for each model track. Storm variables are those that describe the model storm
directl... |
Given forecast and observed track pairings maximum hail sizes are associated with each paired forecast storm track timestep. If the duration of the forecast and observed tracks differ then interpolation is used for the intermediate timesteps. | def match_hail_sizes(model_tracks, obs_tracks, track_pairings):
"""
Given forecast and observed track pairings, maximum hail sizes are associated with each paired forecast storm
track timestep. If the duration of the forecast and observed tracks differ, then interpolation is used for the
... |
Given a matching set of observed tracks for each model track Args: model_tracks: obs_tracks: track_pairings: | def match_hail_size_step_distributions(self, model_tracks, obs_tracks, track_pairings):
"""
Given a matching set of observed tracks for each model track,
Args:
model_tracks:
obs_tracks:
track_pairings:
Returns:
"""
label_... |
Calculates spatial and temporal translation errors between matched forecast and observed tracks. | def calc_track_errors(model_tracks, obs_tracks, track_pairings):
"""
Calculates spatial and temporal translation errors between matched
forecast and observed tracks.
Args:
model_tracks: List of model track STObjects
obs_tracks: List of observed track STObjects
... |
Override from PersistentObject. | def persistent_object_context_changed(self):
""" Override from PersistentObject. """
super().persistent_object_context_changed()
def change_registration(registered_object, unregistered_object):
if registered_object and registered_object.uuid == self.parent_uuid:
self... |
Override from PersistentObject. | def persistent_object_context_changed(self):
""" Override from PersistentObject. """
super().persistent_object_context_changed()
def register():
if self.__source is not None and self.__target is not None:
assert not self.__binding
self.__binding = Bin... |
Override from PersistentObject. | def persistent_object_context_changed(self):
""" Override from PersistentObject. """
super().persistent_object_context_changed()
def detach():
for listener in self.__interval_mutated_listeners:
listener.close()
self.__interval_mutated_listeners = list()
... |
Return the text display for the given tree node. Based on number of keys associated with tree node. | def __display_for_tree_node(self, tree_node):
""" Return the text display for the given tree node. Based on number of keys associated with tree node. """
keys = tree_node.keys
if len(keys) == 1:
return "{0} ({1})".format(tree_node.keys[-1], tree_node.count)
elif len(keys) == ... |
Called from the root tree node when a new node is inserted into tree. This method creates properties to represent the node for display and inserts it into the item model controller. | def __insert_child(self, parent_tree_node, index, tree_node):
"""
Called from the root tree node when a new node is inserted into tree. This method creates properties
to represent the node for display and inserts it into the item model controller.
"""
# manage the item mo... |
Called from the root tree node when a node is removed from the tree. This method removes it into the item model controller. | def __remove_child(self, parent_tree_node, index):
"""
Called from the root tree node when a node is removed from the tree. This method removes it into the
item model controller.
"""
# get parent and item
parent_item = self.__mapping[id(parent_tree_node)]
... |
Update all tree item displays if needed. Usually for count updates. | def update_all_nodes(self):
""" Update all tree item displays if needed. Usually for count updates. """
item_model_controller = self.item_model_controller
if item_model_controller:
if self.__node_counts_dirty:
for item in self.__mapping.values():
i... |
Called to handle selection changes in the tree widget. | def date_browser_selection_changed(self, selected_indexes):
"""
Called to handle selection changes in the tree widget.
This method should be connected to the on_selection_changed event. This method builds a list
of keys represented by all selected items. It then provides dat... |
Called to handle changes to the text filter. | def text_filter_changed(self, text):
"""
Called to handle changes to the text filter.
:param text: The text for the filter.
"""
text = text.strip() if text else None
if text is not None:
self.__text_filter = ListModel.TextFilter("text_for_filter", te... |
Create a combined filter. Set the resulting filter into the document controller. | def __update_filter(self):
"""
Create a combined filter. Set the resulting filter into the document controller.
"""
filters = list()
if self.__date_filter:
filters.append(self.__date_filter)
if self.__text_filter:
filters.append(self.__text_fil... |
Return the keys associated with this node by adding its key and then adding parent keys recursively. | def __get_keys(self):
""" Return the keys associated with this node by adding its key and then adding parent keys recursively. """
keys = list()
tree_node = self
while tree_node is not None and tree_node.key is not None:
keys.insert(0, tree_node.key)
tree_node = t... |
Insert a value ( data item ) into this tree node and then its children. This will be called in response to a new data item being inserted into the document. Also updates the tree node s cumulative child count. | def insert_value(self, keys, value):
"""
Insert a value (data item) into this tree node and then its
children. This will be called in response to a new data item being
inserted into the document. Also updates the tree node's cumulative
child count.
"""
... |
Remove a value ( data item ) from this tree node and its children. Also updates the tree node s cumulative child count. | def remove_value(self, keys, value):
"""
Remove a value (data item) from this tree node and its children.
Also updates the tree node's cumulative child count.
"""
self.count -= 1
if not self.key:
keys = self.__value_reverse_mapping[value]
d... |
From a 2D grid or time series of 2D grids this method labels storm objects with either the Enhanced Watershed or Hysteresis methods. | def label_storm_objects(data, method, min_intensity, max_intensity, min_area=1, max_area=100, max_range=1,
increment=1, gaussian_sd=0):
"""
From a 2D grid or time series of 2D grids, this method labels storm objects with either the Enhanced Watershed
or Hysteresis methods.
Args:... |
After storms are labeled this method extracts the storm objects from the grid and places them into STObjects. The STObjects contain intensity location and shape information about each storm at each timestep. | def extract_storm_objects(label_grid, data, x_grid, y_grid, times, dx=1, dt=1, obj_buffer=0):
"""
After storms are labeled, this method extracts the storm objects from the grid and places them into STObjects.
The STObjects contain intensity, location, and shape information about each storm at each timestep.... |
After storms are labeled this method extracts boxes of equal size centered on each storm from the grid and places them into STObjects. The STObjects contain intensity location and shape information about each storm at each timestep. | def extract_storm_patches(label_grid, data, x_grid, y_grid, times, dx=1, dt=1, patch_radius=16):
"""
After storms are labeled, this method extracts boxes of equal size centered on each storm from the grid and places
them into STObjects. The STObjects contain intensity, location, and shape information about ... |
Given the output of extract_storm_objects this method tracks storms through time and merges individual STObjects into a set of tracks. | def track_storms(storm_objects, times, distance_components, distance_maxima, distance_weights, tracked_objects=None):
"""
Given the output of extract_storm_objects, this method tracks storms through time and merges individual
STObjects into a set of tracks.
Args:
storm_objects: list of list of ... |
Multiclass Peirce Skill Score ( also Hanssen and Kuipers score True Skill Score ) | def peirce_skill_score(self):
"""
Multiclass Peirce Skill Score (also Hanssen and Kuipers score, True Skill Score)
"""
n = float(self.table.sum())
nf = self.table.sum(axis=1)
no = self.table.sum(axis=0)
correct = float(self.table.trace())
return (correct /... |
Gerrity Score which weights each cell in the contingency table by its observed relative frequency.: return: | def gerrity_score(self):
"""
Gerrity Score, which weights each cell in the contingency table by its observed relative frequency.
:return:
"""
k = self.table.shape[0]
n = float(self.table.sum())
p_o = self.table.sum(axis=0) / n
p_sum = np.cumsum(p_o)[:-1]
... |
Euclidean distance between the centroids of item_a and item_b. | def centroid_distance(item_a, time_a, item_b, time_b, max_value):
"""
Euclidean distance between the centroids of item_a and item_b.
Args:
item_a: STObject from the first set in ObjectMatcher
time_a: Time integer being evaluated
item_b: STObject from the second set in ObjectMatcher
... |
Centroid distance with motion corrections. | def shifted_centroid_distance(item_a, time_a, item_b, time_b, max_value):
"""
Centroid distance with motion corrections.
Args:
item_a: STObject from the first set in ObjectMatcher
time_a: Time integer being evaluated
item_b: STObject from the second set in ObjectMatcher
time... |
Euclidean distance between the pixels in item_a and item_b closest to each other. | def closest_distance(item_a, time_a, item_b, time_b, max_value):
"""
Euclidean distance between the pixels in item_a and item_b closest to each other.
Args:
item_a: STObject from the first set in ObjectMatcher
time_a: Time integer being evaluated
item_b: STObject from the second set... |
Calculate differences in the properties of ellipses fitted to each object. | def ellipse_distance(item_a, time_a, item_b, time_b, max_value):
"""
Calculate differences in the properties of ellipses fitted to each object.
Args:
item_a: STObject from the first set in ObjectMatcher
time_a: Time integer being evaluated
item_b: STObject from the second set in Obj... |
Percentage of pixels in each object that do not overlap with the other object | def nonoverlap(item_a, time_a, item_b, time_b, max_value):
"""
Percentage of pixels in each object that do not overlap with the other object
Args:
item_a: STObject from the first set in ObjectMatcher
time_a: Time integer being evaluated
item_b: STObject from the second set in Object... |
RMS difference in maximum intensity | def max_intensity(item_a, time_a, item_b, time_b, max_value):
"""
RMS difference in maximum intensity
Args:
item_a: STObject from the first set in ObjectMatcher
time_a: Time integer being evaluated
item_b: STObject from the second set in ObjectMatcher
time_b: Time integer be... |
RMS Difference in object areas. | def area_difference(item_a, time_a, item_b, time_b, max_value):
"""
RMS Difference in object areas.
Args:
item_a: STObject from the first set in ObjectMatcher
time_a: Time integer being evaluated
item_b: STObject from the second set in ObjectMatcher
time_b: Time integer bein... |
RMS difference in the minimum distances from the centroids of one track to the centroids of another track | def mean_minimum_centroid_distance(item_a, item_b, max_value):
"""
RMS difference in the minimum distances from the centroids of one track to the centroids of another track
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
... |
Calculate the mean time difference among the time steps in each object. | def mean_min_time_distance(item_a, item_b, max_value):
"""
Calculate the mean time difference among the time steps in each object.
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as... |
Distance between the centroids of the first step in each object. | def start_centroid_distance(item_a, item_b, max_value):
"""
Distance between the centroids of the first step in each object.
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as scali... |
Absolute difference between the starting times of each item. | def start_time_distance(item_a, item_b, max_value):
"""
Absolute difference between the starting times of each item.
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as scaling value... |
Absolute difference in the duration of two items | def duration_distance(item_a, item_b, max_value):
"""
Absolute difference in the duration of two items
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as scaling value and upper con... |
Absolute difference in the means of the areas of each track over time. | def mean_area_distance(item_a, item_b, max_value):
"""
Absolute difference in the means of the areas of each track over time.
Args:
item_a: STObject from the first set in TrackMatcher
item_b: STObject from the second set in TrackMatcher
max_value: Maximum distance value used as scal... |
Match two sets of objects at particular times. | def match_objects(self, set_a, set_b, time_a, time_b):
"""
Match two sets of objects at particular times.
Args:
set_a: list of STObjects
set_b: list of STObjects
time_a: time at which set_a is being evaluated for matching
time_b: time at which set... |
Calculates the costs ( distances ) between the items in set a and set b at the specified times. | def cost_matrix(self, set_a, set_b, time_a, time_b):
"""
Calculates the costs (distances) between the items in set a and set b at the specified times.
Args:
set_a: List of STObjects
set_b: List of STObjects
time_a: time at which objects in set_a are evaluated... |
Calculate total cost function between two items. | def total_cost_function(self, item_a, item_b, time_a, time_b):
"""
Calculate total cost function between two items.
Args:
item_a: STObject
item_b: STObject
time_a: Timestep in item_a at which cost function is evaluated
time_b: Timestep in item_b a... |
Find the optimal set of matching assignments between set a and set b. This function supports optimal 1: 1 matching using the Munkres method and matching from every object in set a to the closest object in set b. In this situation set b accepts multiple matches from set a. | def match_tracks(self, set_a, set_b, closest_matches=False):
"""
Find the optimal set of matching assignments between set a and set b. This function supports optimal 1:1
matching using the Munkres method and matching from every object in set a to the closest object in set b.
In this situ... |
For each step in each track from set_a identify all steps in all tracks from set_b that meet all cost function criteria Args: set_a: List of STObjects set_b: List of STObjects | def match(self, set_a, set_b):
"""
For each step in each track from set_a, identify all steps in all tracks from set_b that meet all
cost function criteria
Args:
set_a: List of STObjects
set_b: List of STObjects
Returns:
track_pairing... |
Return the variable specifier for this variable. | def variable_specifier(self) -> dict:
"""Return the variable specifier for this variable.
The specifier can be used to lookup the value of this variable in a computation context.
"""
if self.value_type is not None:
return {"type": "variable", "version": 1, "uuid": str(self.u... |
Return an object with a value property and a changed_event. | def bound_variable(self):
"""Return an object with a value property and a changed_event.
The value property returns the value of the variable. The changed_event is fired
whenever the value changes.
"""
class BoundVariable:
def __init__(self, variable):
... |
Resolve the object specifier. | def resolve_object_specifier(self, object_specifier, secondary_specifier=None, property_name=None, objects_model=None):
"""Resolve the object specifier.
First lookup the object specifier in the enclosing computation. If it's not found,
then lookup in the computation's context. Otherwise it shou... |
Return the list of identifiers used in the expression. | def parse_names(cls, expression):
"""Return the list of identifiers used in the expression."""
names = set()
try:
ast_node = ast.parse(expression, "ast")
class Visitor(ast.NodeVisitor):
def visit_Name(self, node):
names.add(node.id)
... |
Bind a context to this computation. | def bind(self, context) -> None:
"""Bind a context to this computation.
The context allows the computation to convert object specifiers to actual objects.
"""
# make a computation context based on the enclosing context.
self.__computation_context = ComputationContext(self, cont... |
Unlisten and close each bound item. | def unbind(self):
"""Unlisten and close each bound item."""
for variable in self.variables:
self.__unbind_variable(variable)
for result in self.results:
self.__unbind_result(result) |
Sobrepõe: meth: ~satcfe. base. FuncoesSAT. ativar_sat. | def ativar_sat(self, tipo_certificado, cnpj, codigo_uf):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.ativar_sat`.
:return: Uma resposta SAT especilizada em ``AtivarSAT``.
:rtype: satcfe.resposta.ativarsat.RespostaAtivarSAT
"""
retorno = super(ClienteSATLocal, self).ativar_sat(
... |
Sobrepõe: meth: ~satcfe. base. FuncoesSAT. comunicar_certificado_icpbrasil. | def comunicar_certificado_icpbrasil(self, certificado):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.comunicar_certificado_icpbrasil`.
:return: Uma resposta SAT padrão.
:rtype: satcfe.resposta.padrao.RespostaSAT
"""
retorno = super(ClienteSATLocal, self).\
comunica... |
Sobrepõe: meth: ~satcfe. base. FuncoesSAT. enviar_dados_venda. | def enviar_dados_venda(self, dados_venda):
"""Sobrepõe :meth:`~satcfe.base.FuncoesSAT.enviar_dados_venda`.
:return: Uma resposta SAT especializada em ``EnviarDadosVenda``.
:rtype: satcfe.resposta.enviardadosvenda.RespostaEnviarDadosVenda
"""
retorno = super(ClienteSATLocal, self... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.