Skip to content

Inconsistencies in stateful data checks #92

@explodingdinosaurs

Description

@explodingdinosaurs

Some objects, like EVV2G, have the following in the their verify_node function:

validate(self.ports["usage"].initial_value != 0, "EV usage port needs usage profile added.")

The result of which means that, in this case, usage data needs to be supplied upon instantiation. However objects, such as the node and EVDemandProfile do not have these checks. In fact, if you trace the inheritance of the ElectricalDemand port on an EVDemandProfile object you find the Sink object which has the following validator:

non_neg_check = validator("initial_value", allow_reuse=True)(nonnegative_load)

and as Sink inherits from Port, initial_value is assigned a default value:
initial_value: dict = 0

This seems like two types of behaviours that I feel need to be reconciled. Currently in MES, if you want to build a network you need to instantiate a EVV2G with dummy usage and availability data, which is overwritten later. If you're building a network with a EVDemandProfile object, you don't need to insert dummy data into it.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions