Open wsp-mbuckley opened 9 months ago
Create a new property in SegmentsSuper enum class which defines all the segments in a lookup dictionary e.g.
SegmentsSuper
@property def segment_lookup(self) -> dict[SegmentsSuper, Segment]: return { self.MODE: Segment(name=self.value, values={1: "Walk", 2: "Cycle", ... 6: "Rail / underground"}), self.SOC: Segment(name=self.value, values={1: "High Skilled", ... 4: "Skilled"}), }
Replace the match statement in the get_segment method with a dictionary lookup e.g. seg = self.segment_lookup[self]
get_segment
seg = self.segment_lookup[self]
Could be possible to define all the segments in a text file and have segments super load from there to reduce the clutter in the actual Python files?
Create a new property in
SegmentsSuper
enum class which defines all the segments in a lookup dictionary e.g.Replace the match statement in the
get_segment
method with a dictionary lookup e.g.seg = self.segment_lookup[self]
Could be possible to define all the segments in a text file and have segments super load from there to reduce the clutter in the actual Python files?