Skip to content

Commit

Permalink
NEMA split update working. Messy af
Browse files Browse the repository at this point in the history
Signed-off-by: Max <mcschrader@crimson.ua.edu>
  • Loading branch information
mschrader15 committed Apr 29, 2024
1 parent 78cd465 commit a6bd6c9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
15 changes: 8 additions & 7 deletions sumo_pipelines/blocks/io/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,14 @@ def rm_file(config: RemoveFileConfig, parent_config: OmegaConf) -> None:
if os.path.isfile(f):
os.remove(f)
print(f"Removed file: {f}")
try:
p = Path(f)
for _p in p.parent.glob(f"{p.name}"):
_p.unlink()
print(f"Removed file: {_p}")
except Exception:
print(f"Error removing file: {f}")
else:
try:
p = Path(f)
for _p in p.parent.glob(f"{p.name}"):
os.remove(str(_p))
print(f"Removed file: {_p}")
except Exception:
print(f"Error removing file: {f}")


def build_duckdb_database(config: DuckDBConfig, *args, **kwargs) -> None:
Expand Down
10 changes: 5 additions & 5 deletions sumo_pipelines/utils/nema_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,17 +597,17 @@ def add_params_to_xml(
# test the NEMALight class

tl = NEMALight.from_xml(
"/Users/max/Development/DOE-Project/airport-harper-calibration/simulation/additional/signals/63082004.NEMA.Coordinated.xml",
id="63082004",
programID="63082004_12",
"/Users/max/Development/DOE-Project/airport-harper-calibration/simulation/additional/signals/63082002.NEMA.Coordinated.xml",
id="63082002",
programID="63082002_12",
)

tl.update_offset(22)

tl.update_coordinate_splits(
{
2: (0.6869433365740374 // 0.01) * 0.01,
6: (0.72 // 0.01) * 0.01,
2: 0.5764271155153771,
6: 0.85,
}
)

Expand Down

0 comments on commit a6bd6c9

Please sign in to comment.