lmpy.data_wrangling.occurrence.base

Module containing Occurrence Data Wrangler base class.

Module Contents

Classes

_OccurrenceDataWrangler

Constructor for _OcccurrenceDataWrangler base class.

class lmpy.data_wrangling.occurrence.base._OccurrenceDataWrangler(store_attribute=None, pass_value=0, fail_value=1, **params)[source]

Bases: lmpy.data_wrangling.base._DataWrangler

Constructor for _OcccurrenceDataWrangler base class.

Parameters
  • store_attribute (str or None) – If provided, add an assessment field to the point.

  • pass_value (object) – If the point passes the assessment, set the field to this value.

  • fail_value (object) – If the point fails the assessment, set the field to this value.

  • **params (dict) – A dictionary of keyword parameters.

name = _OccurrenceDataWrangler[source]
_modify_point(self, point)[source]

A function that modifies a Point object as needed.

The base class version is a dummy function that returns the input point.

Parameters

point (Point) – A point object to modify.

Returns

Return the provided point and False indicating that it was not

modified.

Return type

Point, bool

_pass_condition(self, point)[source]

A function that determines if a point passes some criteria.

The base class version always passes.

Parameters

point (Point) – A point object to assess.

Returns

Indication if the point passes the test condition.

Return type

bool

get_report(self)[source]

Get a report of the wrangler’s functioning.

Returns

A dictionary of wrangler outputs.

Return type

dict

report_point(self, filtered=False, modified=False)[source]

Report the result of wrangling a point.

Parameters
  • filtered (bool) – Was the point filtered.

  • modified (bool) – Was the point modified.

wrangle_points(self, points)[source]

Wrangle occurrence Point objects.

Parameters

points (list of Point) – A list of points to wrangle.

Returns

A list of wrangled occurrnece points.

Return type

list of point

wrangle_single_point(self, point)[source]

Wrangle a single point.

Parameters

point (Point) – A point object to wrangle.

Returns

An assessed and / or modified point or None if filtered.

Return type

Point or None