Closed jschalk closed 1 month ago
This pull request implements changes to create a BridgeUnit directly from CSV files. It modifies the existing code to handle CSV file operations more efficiently and introduces new functionality for loading and saving BridgeUnit data from/to CSV files.
sequenceDiagram
participant User
participant System
participant BridgeUnit
participant BridgeKind
User->>System: Request to load BridgeUnit from CSV
System->>BridgeUnit: create_dir_valid_bridgeunit(x_dir)
loop for each BridgeKind
BridgeUnit->>BridgeKind: _load_otx_to_inx_from_csv(x_dir)
BridgeUnit->>BridgeKind: _load_explicit_label_from_csv(x_dir)
end
System->>User: Return loaded BridgeUnit
sequenceDiagram
participant User
participant System
participant BridgeUnit
participant BridgeKind
User->>System: Request to save BridgeUnit to CSV
System->>BridgeUnit: save_all_csvs_from_bridgeunit(x_dir)
loop for each BridgeKind
BridgeUnit->>BridgeKind: _save_otx_to_inx_csv(x_dir)
BridgeUnit->>BridgeKind: _save_explicit_label_csv(x_dir)
end
System->>User: Confirm save operation
classDiagram
class BridgeKind {
+OwnerID face_id
+dict explicit_label
+str python_type
+set_all_otx_to_inx(dict, bool)
}
class BridgeUnit {
+OwnerID face_id
+dict[str, BridgeKind] bridgekinds
+str unknown_word
+str otx_road_delimiter
+str inx_road_delimiter
}
BridgeUnit --> BridgeKind : contains
class OwnerID {
<<datatype>>
}
Change | Details | Files |
---|---|---|
Refactor CSV file handling for BridgeUnit |
|
src/f09_filter/bridge.py src/f09_filter/test/test_bridgeunit_dict.py |
Implement new functions for creating and loading BridgeUnit from CSV files |
|
src/f09_filter/bridge.py src/f09_filter/test/test_bridgeunit_dict.py |
Update data type for 'face_id' attribute |
|
src/f09_filter/bridge.py |
Summary by Sourcery
Introduce the ability to create a BridgeUnit directly from CSV files, enhancing the data handling capabilities. Refactor existing code to use OwnerID for face_id attributes, improving type safety. Update and add tests to ensure the new CSV handling functionality works as expected.
New Features:
Enhancements:
Tests: