ubc-solar-physics 1.0.5__tar.gz → 1.1.0__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.
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/PKG-INFO +1 -1
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/_version.py +2 -2
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/environment/__init__.py +0 -7
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/environment/meteorology/clouded_meteorology.py +4 -5
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/environment/meteorology/irradiant_meteorology.py +5 -4
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/ubc_solar_physics.egg-info/PKG-INFO +1 -1
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/ubc_solar_physics.egg-info/SOURCES.txt +0 -1
- ubc_solar_physics-1.0.5/physics/environment/race.py +0 -89
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/.github/pull_request_template.md +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/.github/workflows/build_and_publish.yaml +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/.github/workflows/run_tests.yaml +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/.gitignore +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/.readthedocs.yaml +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/Cargo.lock +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/Cargo.toml +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/LICENSE +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/README.md +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/docs/Makefile +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/docs/_generate_version.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/docs/docs_requirements.txt +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/docs/make.bat +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/docs/source/README.md +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/docs/source/api.rst +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/docs/source/conf.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/docs/source/environment/gis.rst +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/docs/source/environment/index.rst +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/docs/source/environment/meteorology.rst +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/docs/source/index.rst +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/docs/source/models/arrays.rst +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/docs/source/models/battery.rst +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/docs/source/models/index.rst +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/docs/source/models/lvs.rst +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/docs/source/models/motor.rst +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/docs/source/models/regen.rst +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/__init__.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/environment/environment.rs +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/environment/gis/__init__.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/environment/gis/base_gis.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/environment/gis/gis.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/environment/gis/gis.rs +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/environment/gis.rs +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/environment/meteorology/__init__.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/environment/meteorology/base_meteorology.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/environment/meteorology/meteorology.rs +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/environment/meteorology.rs +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/environment.rs +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/lib.rs +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/__init__.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/arrays/__init__.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/arrays/arrays.rs +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/arrays/base_array.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/arrays/basic_array.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/arrays.rs +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/battery/__init__.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/battery/base_battery.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/battery/basic_battery.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/battery/battery.rs +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/battery.rs +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/constants.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/lvs/__init__.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/lvs/base_lvs.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/lvs/basic_lvs.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/lvs/lvs.rs +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/lvs.rs +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/motor/__init__.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/motor/base_motor.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/motor/basic_motor.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/motor/motor.rs +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/motor.rs +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/regen/__init__.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/regen/base_regen.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/regen/basic_regen.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/regen/regen.rs +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models/regen.rs +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/models.rs +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/pyproject.toml +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/setup.cfg +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/tests/test_versioning.py +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/ubc_solar_physics.egg-info/dependency_links.txt +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/ubc_solar_physics.egg-info/requires.txt +0 -0
- {ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/ubc_solar_physics.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ubc-solar-physics
|
3
|
-
Version: 1.0
|
3
|
+
Version: 1.1.0
|
4
4
|
Summary: UBC Solar's Simulation Environment
|
5
5
|
Author: Fisher Xue, Mihir Nimgade, Chris Chang, David Widjaja, Justin Hua, Ilya Veksler, Renu Rajamagesh, Ritchie Xia, Erik Langille, Chris Aung, Nicolas Ric, Ishaan Trivedi, Jason Liang, Felix Toft, Mack Wilson, Jonah Lee, Tamzeed Quazi, Joshua Riefman
|
6
6
|
Author-email: UBC Solar <strategy@ubcsolar.com>
|
@@ -1,7 +1,6 @@
|
|
1
1
|
from physics.environment.meteorology.base_meteorology import BaseMeteorology
|
2
2
|
from physics.environment.gis.gis import calculate_path_distances
|
3
3
|
import numpy as np
|
4
|
-
from physics.environment.race import Race
|
5
4
|
from numba import jit
|
6
5
|
import core
|
7
6
|
from typing import Optional
|
@@ -28,7 +27,7 @@ class CloudedMeteorology(BaseMeteorology):
|
|
28
27
|
|
29
28
|
self.last_updated_time = self._weather_forecast[0, 0, 2]
|
30
29
|
|
31
|
-
def spatially_localize(self, cumulative_distances: np.ndarray) -> None:
|
30
|
+
def spatially_localize(self, cumulative_distances: np.ndarray, simplify_weather: bool = False) -> None:
|
32
31
|
"""
|
33
32
|
|
34
33
|
IMPORTANT: we only have weather coordinates for a discrete set of coordinates. However, the car could be at any
|
@@ -46,14 +45,14 @@ class CloudedMeteorology(BaseMeteorology):
|
|
46
45
|
`get_weather_forecast_in_time()` method.
|
47
46
|
|
48
47
|
:param np.ndarray cumulative_distances: NumPy Array representing cumulative distances theoretically achievable for a given input speed array
|
49
|
-
|
48
|
+
:param bool simplify_weather: enable to only use a single weather coordinate (for track races without varying weather)
|
50
49
|
"""
|
51
50
|
|
52
|
-
#
|
51
|
+
# If racing a track race, there is no need for distance calculations. We will return only the origin coordinate
|
53
52
|
# This characterizes the weather at every point along the FSGP tracks
|
54
53
|
# with the weather at a single coordinate on the track, which is great for reducing the API calls and is a
|
55
54
|
# reasonable assumption to make for FSGP only.
|
56
|
-
if
|
55
|
+
if simplify_weather:
|
57
56
|
self._weather_indices = np.zeros_like(cumulative_distances, dtype=int)
|
58
57
|
return
|
59
58
|
|
@@ -1,7 +1,6 @@
|
|
1
1
|
from physics.environment.meteorology.base_meteorology import BaseMeteorology
|
2
2
|
from physics.environment.gis.gis import calculate_path_distances
|
3
3
|
import numpy as np
|
4
|
-
from physics.environment.race import Race
|
5
4
|
import core
|
6
5
|
from typing import Optional
|
7
6
|
|
@@ -25,16 +24,18 @@ class IrradiantMeteorology(BaseMeteorology):
|
|
25
24
|
|
26
25
|
super().__init__()
|
27
26
|
|
28
|
-
def spatially_localize(self, cumulative_distances: np.ndarray) -> None:
|
27
|
+
def spatially_localize(self, cumulative_distances: np.ndarray, simplify_weather: bool = False) -> None:
|
29
28
|
"""
|
30
29
|
|
31
30
|
:param np.ndarray cumulative_distances: NumPy Array representing cumulative distances theoretically achievable for a given input speed array
|
31
|
+
:param bool simplify_weather: enable to only use a single weather coordinate (for track races without varying weather)
|
32
|
+
|
32
33
|
"""
|
33
|
-
#
|
34
|
+
# If racing a track race, there is no need for distance calculations. We will return only the origin coordinate
|
34
35
|
# This characterizes the weather at every point along the FSGP tracks
|
35
36
|
# with the weather at a single coordinate on the track, which is great for reducing the API calls and is a
|
36
37
|
# reasonable assumption to make for FSGP only.
|
37
|
-
if
|
38
|
+
if simplify_weather:
|
38
39
|
self._weather_indices = np.zeros_like(cumulative_distances, dtype=int)
|
39
40
|
return
|
40
41
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ubc-solar-physics
|
3
|
-
Version: 1.0
|
3
|
+
Version: 1.1.0
|
4
4
|
Summary: UBC Solar's Simulation Environment
|
5
5
|
Author: Fisher Xue, Mihir Nimgade, Chris Chang, David Widjaja, Justin Hua, Ilya Veksler, Renu Rajamagesh, Ritchie Xia, Erik Langille, Chris Aung, Nicolas Ric, Ishaan Trivedi, Jason Liang, Felix Toft, Mack Wilson, Jonah Lee, Tamzeed Quazi, Joshua Riefman
|
6
6
|
Author-email: UBC Solar <strategy@ubcsolar.com>
|
@@ -34,7 +34,6 @@ physics/environment/__init__.py
|
|
34
34
|
physics/environment/environment.rs
|
35
35
|
physics/environment/gis.rs
|
36
36
|
physics/environment/meteorology.rs
|
37
|
-
physics/environment/race.py
|
38
37
|
physics/environment/gis/__init__.py
|
39
38
|
physics/environment/gis/base_gis.py
|
40
39
|
physics/environment/gis/gis.py
|
@@ -1,89 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
This class collects the constants that are related to a specific competition.
|
3
|
-
"""
|
4
|
-
import pathlib
|
5
|
-
|
6
|
-
import numpy as np
|
7
|
-
import pickle
|
8
|
-
import enum
|
9
|
-
import json
|
10
|
-
import os
|
11
|
-
|
12
|
-
|
13
|
-
class Race:
|
14
|
-
class RaceType(enum.Enum):
|
15
|
-
ASC = "ASC"
|
16
|
-
FSGP = "FSGP"
|
17
|
-
|
18
|
-
def __str__(self):
|
19
|
-
match self.value:
|
20
|
-
case "ASC":
|
21
|
-
return "ASC"
|
22
|
-
case "FSGP":
|
23
|
-
return "FSGP"
|
24
|
-
|
25
|
-
def __reduce__(self):
|
26
|
-
return self.__class__, (self.name,)
|
27
|
-
|
28
|
-
def __contains__(self, item):
|
29
|
-
return item == "ASC" or item == "FSGP"
|
30
|
-
|
31
|
-
def __repr__(self):
|
32
|
-
return str(self)
|
33
|
-
|
34
|
-
ASC = RaceType.ASC
|
35
|
-
FSGP = RaceType.FSGP
|
36
|
-
|
37
|
-
def __init__(self, race_type: RaceType, race_constants: dict):
|
38
|
-
self.race_type = race_type
|
39
|
-
|
40
|
-
self.days = race_constants["days"]
|
41
|
-
self.tiling = race_constants["tiling"]
|
42
|
-
self.date = (race_constants["start_year"], race_constants["start_month"], race_constants["start_day"])
|
43
|
-
|
44
|
-
self.race_duration = len(self.days) * 24 * 60 * 60 # Duration (s)
|
45
|
-
self.driving_boolean = self.make_time_boolean("driving")
|
46
|
-
self.charging_boolean = self.make_time_boolean("charging")
|
47
|
-
|
48
|
-
def __str__(self):
|
49
|
-
return str(self.race_type)
|
50
|
-
|
51
|
-
def write(self, race_directory: pathlib.Path):
|
52
|
-
with open(race_directory / f"{str(self.race_type)}.pkl", 'wb') as outfile:
|
53
|
-
pickle.dump(self, outfile, protocol=pickle.HIGHEST_PROTOCOL)
|
54
|
-
|
55
|
-
def make_time_boolean(self, boolean_type: str):
|
56
|
-
boolean: np.ndarray = np.empty(self.race_duration, dtype=np.int8)
|
57
|
-
DAY_LENGTH: int = 24 * 60 * 60 # Length of a day in seconds
|
58
|
-
|
59
|
-
for tick in range(len(boolean)):
|
60
|
-
day: int = tick // DAY_LENGTH # Integer division to determine how many days have passed
|
61
|
-
time_of_day = tick % DAY_LENGTH # Time of day in seconds where 0 is midnight and 43200 is noon
|
62
|
-
begin, end = self.days[str(day)][boolean_type]
|
63
|
-
|
64
|
-
# If the time of day is between the beginning and end, then the boolean is True, else False
|
65
|
-
boolean[tick] = begin <= time_of_day < end
|
66
|
-
|
67
|
-
return boolean
|
68
|
-
|
69
|
-
|
70
|
-
def load_race(race_type: Race.RaceType, race_directory: pathlib.Path) -> Race:
|
71
|
-
with open(race_directory / f"{str(race_type)}.pkl", 'rb') as infile:
|
72
|
-
return pickle.load(infile)
|
73
|
-
|
74
|
-
|
75
|
-
def compile_races(config_directory: pathlib.Path, race_directory: pathlib.Path):
|
76
|
-
fsgp_config_path = os.path.join(config_directory, f"settings_FSGP.json")
|
77
|
-
asc_config_path = os.path.join(config_directory, f"settings_ASC.json")
|
78
|
-
|
79
|
-
with open(fsgp_config_path) as f:
|
80
|
-
fsgp_race_constants = json.load(f)
|
81
|
-
|
82
|
-
with open(asc_config_path) as f:
|
83
|
-
asc_race_constants = json.load(f)
|
84
|
-
|
85
|
-
fsgp = Race(Race.FSGP, fsgp_race_constants)
|
86
|
-
fsgp.write(race_directory)
|
87
|
-
|
88
|
-
asc = Race(Race.ASC, asc_race_constants)
|
89
|
-
asc.write(race_directory)
|
File without changes
|
{ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/.github/workflows/build_and_publish.yaml
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/environment/meteorology/__init__.py
RENAMED
File without changes
|
File without changes
|
{ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/physics/environment/meteorology/meteorology.rs
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/ubc_solar_physics.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
{ubc_solar_physics-1.0.5 → ubc_solar_physics-1.1.0}/ubc_solar_physics.egg-info/top_level.txt
RENAMED
File without changes
|