blocksnet.method.base_method

Classes

BaseMethod(*, city_model[, verbose])

BaseMethod class required for methods implementation.

class blocksnet.method.base_method.BaseMethod(*, city_model: City, verbose: bool = True)[source]

Bases: ABC, BaseModel

BaseMethod class required for methods implementation.

Variables:
  • city_model (InstanceOf[City]) – Instance of the City model used in the method.

  • verbose (bool, optional) – Whether to display progress, default is True.

calculate(*args, \*\*kwargs) any[source]

Main calculation method that should be overridden in child class.

plot(*args, \*\*kwargs) any[source]

Plot method that can be overridden in child class.

city_model: City
verbose: bool
calculate(*args, **kwargs) any[source]

Main calculation method that should be overridden in child class.

Parameters:
  • *args (tuple) – Variable length argument list.

  • **kwargs (dict) – Arbitrary keyword arguments.

Raises:

NotImplementedError – If the method is not implemented in the child class.

plot(*args, **kwargs) any[source]

Plot method that can be overridden in child class.

Parameters:
  • *args (tuple) – Variable length argument list.

  • **kwargs (dict) – Arbitrary keyword arguments.

Raises:

NotImplementedError – If the method is not implemented in the child class.

model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.