eflips-depot 3.0.0__tar.gz → 3.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of eflips-depot might be problematic. Click here for more details.

Files changed (59) hide show
  1. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/PKG-INFO +1 -1
  2. eflips_depot-3.0.2/eflips/depot/.DS_Store +0 -0
  3. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/api/__init__.py +60 -17
  4. eflips_depot-3.0.2/eflips/depot/api/__pycache__/__init__.cpython-311.pyc +0 -0
  5. eflips_depot-3.0.2/eflips/depot/api/__pycache__/__init__.cpython-312.pyc +0 -0
  6. eflips_depot-3.0.2/eflips/depot/api/private/__pycache__/__init__.cpython-312.pyc +0 -0
  7. eflips_depot-3.0.2/eflips/depot/api/private/__pycache__/depot.cpython-312.pyc +0 -0
  8. eflips_depot-3.0.2/eflips/depot/api/private/__pycache__/depot_layout.cpython-312.pyc +0 -0
  9. eflips_depot-3.0.2/eflips/depot/api/private/__pycache__/util.cpython-312.pyc +0 -0
  10. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/api/private/depot.py +1 -1
  11. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/depot.py +164 -90
  12. eflips_depot-3.0.2/eflips/depot/layout_opt/__pycache__/__init__.cpython-311.pyc +0 -0
  13. eflips_depot-3.0.2/eflips/depot/layout_opt/__pycache__/__init__.cpython-312.pyc +0 -0
  14. eflips_depot-3.0.2/eflips/depot/layout_opt/__pycache__/evaluation.cpython-311.pyc +0 -0
  15. eflips_depot-3.0.2/eflips/depot/layout_opt/__pycache__/packing.cpython-311.pyc +0 -0
  16. eflips_depot-3.0.2/eflips/depot/layout_opt/__pycache__/settings.cpython-311.pyc +0 -0
  17. eflips_depot-3.0.2/eflips/depot/layout_opt/__pycache__/util.cpython-311.pyc +0 -0
  18. eflips_depot-3.0.2/eflips/depot/layout_opt/opt_tools/__pycache__/__init__.cpython-311.pyc +0 -0
  19. eflips_depot-3.0.2/eflips/depot/layout_opt/opt_tools/__pycache__/crossover.cpython-311.pyc +0 -0
  20. eflips_depot-3.0.2/eflips/depot/layout_opt/opt_tools/__pycache__/fitness_c_urfd.cpython-311.pyc +0 -0
  21. eflips_depot-3.0.2/eflips/depot/layout_opt/opt_tools/__pycache__/fitness_util.cpython-311.pyc +0 -0
  22. eflips_depot-3.0.2/eflips/depot/layout_opt/opt_tools/__pycache__/init.cpython-311.pyc +0 -0
  23. eflips_depot-3.0.2/eflips/depot/layout_opt/opt_tools/__pycache__/mutation.cpython-311.pyc +0 -0
  24. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/processes.py +53 -34
  25. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/pyproject.toml +1 -1
  26. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/LICENSE.md +0 -0
  27. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/README.md +0 -0
  28. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/__init__.py +0 -0
  29. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/api/defaults/default_settings.json +0 -0
  30. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/api/private/__init__.py +0 -0
  31. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/api/private/util.py +0 -0
  32. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/configuration.py +0 -0
  33. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/evaluation.py +0 -0
  34. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/filters.py +0 -0
  35. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/input_epex_power_price.py +0 -0
  36. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/layout_opt/__init__.py +0 -0
  37. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/layout_opt/doc/__init__.py +0 -0
  38. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/layout_opt/doc/direct_details.pdf +0 -0
  39. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/layout_opt/evaluation.py +0 -0
  40. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/layout_opt/opt_tools/__init__.py +0 -0
  41. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/layout_opt/opt_tools/crossover.py +0 -0
  42. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/layout_opt/opt_tools/fitness_c_urfd.py +0 -0
  43. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/layout_opt/opt_tools/fitness_util.py +0 -0
  44. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/layout_opt/opt_tools/init.py +0 -0
  45. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/layout_opt/opt_tools/mutation.py +0 -0
  46. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/layout_opt/optimize_c_urfd.py +0 -0
  47. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/layout_opt/packing.py +0 -0
  48. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/layout_opt/settings.py +0 -0
  49. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/layout_opt/template_creation.py +0 -0
  50. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/layout_opt/util.py +0 -0
  51. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/plots.py +0 -0
  52. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/rating.py +0 -0
  53. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/resources.py +0 -0
  54. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/settings_config.py +0 -0
  55. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/simple_vehicle.py +0 -0
  56. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/simulation.py +0 -0
  57. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/smart_charging.py +0 -0
  58. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/standalone.py +0 -0
  59. {eflips_depot-3.0.0 → eflips_depot-3.0.2}/eflips/depot/validation.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: eflips-depot
3
- Version: 3.0.0
3
+ Version: 3.0.2
4
4
  Summary: Depot Simulation for eFLIPS
5
5
  License: AGPLv3
6
6
  Author: Enrico Lauth
@@ -724,11 +724,7 @@ def add_evaluation_to_database(
724
724
  else:
725
725
  for process in process_log:
726
726
  match process.status:
727
- case ProcessStatus.CANCELLED:
728
- raise NotImplementedError(
729
- f"Cancelled processes {process.ID} are not implemented."
730
- )
731
- case ProcessStatus.COMPLETED:
727
+ case ProcessStatus.COMPLETED | ProcessStatus.CANCELLED:
732
728
  assert (
733
729
  len(process.starts) == 1 and len(process.ends) == 1
734
730
  ), (
@@ -754,13 +750,38 @@ def add_evaluation_to_database(
754
750
  }
755
751
  else:
756
752
  # Duration is 0
757
-
758
- if start_time in dict_of_events:
759
- assert current_area.issink is True
753
+ if current_area.issink is True:
760
754
  # Standby departure
761
- actual_start_time = dict_of_events[start_time][
762
- "end"
763
- ]
755
+ if start_time in dict_of_events:
756
+ # Actual start time should be the end time of the other positive duration
757
+ # process starting at the same time
758
+ actual_start_time = dict_of_events[
759
+ start_time
760
+ ]["end"]
761
+ else:
762
+ for other_process in process_log:
763
+ if (
764
+ other_process.dur > 0
765
+ and len(other_process.ends) != 0
766
+ ):
767
+ actual_start_time = (
768
+ other_process.ends[0]
769
+ )
770
+ else:
771
+ # Invalid standby before a process in progress will be ignored
772
+ continue
773
+
774
+ last_standby_departure_start = actual_start_time
775
+
776
+ # If this standby event lasts actually 0 seconds, it is not a real event
777
+ if (
778
+ actual_start_time in dict_of_events.keys()
779
+ and dict_of_events[actual_start_time][
780
+ "type"
781
+ ]
782
+ == "trip"
783
+ ):
784
+ continue
764
785
  dict_of_events[actual_start_time] = {
765
786
  "type": type(process).__name__,
766
787
  "area": current_area.ID,
@@ -769,11 +790,12 @@ def add_evaluation_to_database(
769
790
  "id": process.ID,
770
791
  }
771
792
 
772
- last_standby_departure_start = actual_start_time
773
-
774
793
  else:
775
794
  # Standby arrival
776
- assert current_area.issink is False
795
+ assert current_area.issink is False, (
796
+ f"A bus cannot go from Area {current_area.ID} to other areas. A Parking Area"
797
+ f" for standby arrival should be added."
798
+ )
777
799
  dict_of_events[start_time] = {
778
800
  "type": type(process).__name__,
779
801
  "area": current_area.ID,
@@ -782,9 +804,30 @@ def add_evaluation_to_database(
782
804
  "id": process.ID,
783
805
  }
784
806
  case ProcessStatus.IN_PROGRESS:
785
- raise NotImplementedError(
786
- f"Current process {process.ID} is in progress. Not implemented yet."
787
- )
807
+ assert (
808
+ len(process.starts) == 1 and len(process.ends) == 0
809
+ ), f"Current process {process.ID} is marked IN_PROGRESS, but has an end."
810
+ current_area = area_log[start_time]
811
+ current_slot = slot_log[start_time]
812
+
813
+ if current_area is None or current_slot is None:
814
+ raise ValueError(
815
+ f"For process {process.ID} Area and slot should not be None."
816
+ )
817
+
818
+ if process.dur > 0:
819
+ # Valid duration
820
+ dict_of_events[start_time] = {
821
+ "type": type(process).__name__,
822
+ "end": process.etc,
823
+ "area": current_area.ID,
824
+ "slot": current_slot,
825
+ "id": process.ID,
826
+ }
827
+ else:
828
+ raise NotImplementedError(
829
+ "We believe this should never happen. If it happens, handle it here."
830
+ )
788
831
  case ProcessStatus.WAITING:
789
832
  raise NotImplementedError(
790
833
  f"Current process {process.ID} is waiting. Not implemented yet."
@@ -137,7 +137,7 @@ def depot_to_template(depot: Depot) -> Dict[str, str | Dict[str, str | int]]:
137
137
  "ismandatory": True,
138
138
  "vehicle_filter": {},
139
139
  # True if this process can be interrupted by a dispatch. False if it cannot be interrupted
140
- "cancellable_for_dispatch": False,
140
+ "cancellable_for_dispatch": process.dispatchable,
141
141
  }
142
142
 
143
143
  match process_type(process):