Skip to content
Open
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
5dd5ddd
Update
ppinchuk Dec 3, 2025
a30e668
Update
ppinchuk Dec 3, 2025
7f603ad
Merge remote-tracking branch 'origin/main' into pp/routing_module
ppinchuk Dec 6, 2025
515b2ac
Update lockfile
ppinchuk Dec 6, 2025
a3044b0
Add new exception type
ppinchuk Dec 6, 2025
b0e4dc3
Add another error type
ppinchuk Dec 6, 2025
60c1fca
Log class names
ppinchuk Dec 6, 2025
c880945
Update tests to check for name
ppinchuk Dec 6, 2025
1601907
Update logic to look for shape dataset
ppinchuk Dec 7, 2025
74bd763
Add first few tests for routing
ppinchuk Dec 7, 2025
6fec6e9
Routing WIP!!
ppinchuk Dec 7, 2025
a3f4c3d
More tests
ppinchuk Dec 7, 2025
953561b
Add test
ppinchuk Dec 7, 2025
9213d5b
Add test
ppinchuk Dec 7, 2025
c1bc645
Fix typo
ppinchuk Dec 7, 2025
f483595
Fix bug
ppinchuk Dec 7, 2025
08b14b3
Add tracked layers test
ppinchuk Dec 7, 2025
5bffe8a
Add geometry test
ppinchuk Dec 7, 2025
7e5df95
A few more tests
ppinchuk Dec 7, 2025
fd86ec3
Add `__init__.py` to module
ppinchuk Dec 9, 2025
97f49fb
Updates
ppinchuk Dec 9, 2025
4e82865
Don't allow negative costs
ppinchuk Dec 9, 2025
9b31040
Add tests for invalid start/end costs
ppinchuk Dec 9, 2025
dce81b3
Check for error message logs
ppinchuk Dec 9, 2025
fe8ee72
Add routing utility tests
ppinchuk Dec 9, 2025
a80c677
Add utilities module
ppinchuk Dec 9, 2025
2438141
Update docstrings
ppinchuk Dec 9, 2025
54ca855
Add first pass of cli file
ppinchuk Dec 10, 2025
57f558e
Minor updates
ppinchuk Dec 10, 2025
d82b8ae
Connect first routing CLI
ppinchuk Dec 10, 2025
fe8f4aa
Add changes to points logic
ppinchuk Dec 10, 2025
fa64388
Minor docstring updates
ppinchuk Dec 10, 2025
2faaa31
Update
ppinchuk Dec 10, 2025
b16bef0
Partially fix tests
ppinchuk Dec 10, 2025
e9fa521
Fix tests
ppinchuk Dec 10, 2025
ed91627
Add docstrings
ppinchuk Dec 10, 2025
2fe36fb
Minor updates
ppinchuk Dec 10, 2025
3117127
Fix docs
ppinchuk Dec 10, 2025
b12b5e6
No extra log
ppinchuk Dec 10, 2025
73dd974
Fix recursion error
ppinchuk Dec 10, 2025
fbec893
Add tests
ppinchuk Dec 10, 2025
7cd8bd4
MVP routing CLI tests
ppinchuk Dec 10, 2025
c78f4f6
Minor refactor
ppinchuk Dec 10, 2025
e614fa6
Minor formatting
ppinchuk Dec 10, 2025
15cd004
update tests
ppinchuk Dec 10, 2025
024e837
Update tests
ppinchuk Dec 10, 2025
3c796a0
Merge remote-tracking branch 'origin/main' into pp/routing_module
ppinchuk Dec 10, 2025
45e5d39
Update lockfile
ppinchuk Dec 10, 2025
8ad80fe
Merge remote-tracking branch 'origin/main' into pp/routing_module
ppinchuk Dec 10, 2025
06dad47
MInor formatting
ppinchuk Dec 10, 2025
b53749e
Update instructions
ppinchuk Dec 10, 2025
d4968ac
Break out dictionary extraction
ppinchuk Dec 10, 2025
eb0fe31
Minor update
ppinchuk Dec 10, 2025
bc2a0fc
Docstrings
ppinchuk Dec 10, 2025
bb49f8d
Add a few tests
ppinchuk Dec 10, 2025
dbaad90
Update
ppinchuk Dec 10, 2025
cd2d559
Minor fix
ppinchuk Dec 10, 2025
21fe9b6
More messages
ppinchuk Dec 10, 2025
891b822
Use `da.max`
ppinchuk Dec 10, 2025
90dc0c3
Fix rust tests
ppinchuk Dec 10, 2025
6d0edd8
Merge remote-tracking branch 'origin/main' into pp/routing_module
ppinchuk Dec 11, 2025
91d72d7
Minor refactor
ppinchuk Dec 11, 2025
0dd2217
Much lower memory limit
ppinchuk Dec 11, 2025
1188678
`add_layer_to_data` now returns `Result` object
ppinchuk Dec 12, 2025
22e2519
More error types
ppinchuk Dec 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ body:
attributes:
label: Charge code
placeholder: >
If you are at NREL and fixing this bug is urgent, please provide a charge code
If you are at NLR and fixing this bug is urgent, please provide a charge code
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ body:
attributes:
label: Charge code
placeholder: >
If you are at NREL and implementing this feature is urgent, please provide a charge code
If you are at NLR and implementing this feature is urgent, please provide a charge code
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Welcome to reV Routing (reVRt)!
.. |Pixi| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/prefix-dev/pixi/main/assets/badge/v0.json
:target: https://pixi.sh

.. |SWR| image:: https://img.shields.io/badge/SWR--25--112_-blue?label=NREL
.. |SWR| image:: https://img.shields.io/badge/SWR--25--112_-blue?label=NLR
:alt: Static Badge

.. |Zenodo| image:: https://zenodo.org/badge/944738283.svg
Expand Down
12 changes: 10 additions & 2 deletions crates/revrt/src/dataset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,16 @@ impl Dataset {
let name = entry.split('/').next().unwrap_or("").to_ascii_lowercase();
const EXCLUDES: [&str; 6] =
["latitude", "longitude", "band", "x", "y", "spatial_ref"];
!name.ends_with(".json") && !EXCLUDES.iter().any(|needle| name.contains(needle))
!name.ends_with(".json") && !EXCLUDES.iter().any(|needle| name == *needle)
})
.expect("no suitable variables found in source dataset");
.unwrap_or_else(|| {
panic!(
"no non-coordinate variables found in source dataset: {:?}",
source
.list()
.unwrap_or_else(|err| panic!("failed to list dataset entries: {err}"))
)
});
// Skip coordinate axes when selecting a representative variable for cost storage.
let varname = first_entry.split('/').next().unwrap().to_string();
debug!("Using '{}' to determine shape of cost data", varname);
Expand Down Expand Up @@ -285,6 +292,7 @@ impl Dataset {
let neighbors = neighbors
.iter()
.filter(|((ir, jr), _)| !(*ir == i && *jr == j)) // no center point
.filter(|((_, _), v)| *v > 0.) // only positive costs
.map(|((ir, jr), v)| ((ir, jr), 0.5 * (v + center.1)))
.map(|((ir, jr), v)| {
if *ir != i && *jr != j {
Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

project = "reVRt"
copyright = "2025, Alliance for Sustainable Energy, LLC"
author = "NREL: Guilherme Pimenta Castelao, Paul Pinchuk"
author = "NLR: Guilherme Pimenta Castelao, Paul Pinchuk"

pkg = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
pkg = os.path.dirname(pkg)
Expand Down Expand Up @@ -135,7 +135,7 @@

html_context = {
"display_github": True,
"github_user": "nrel",
"github_user": "nlr",
"github_repo": "reVRt",
"github_version": "main",
"conf_py_path": "/docs/source/",
Expand Down
7 changes: 1 addition & 6 deletions docs/source/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ supporting technologies referenced throughout the reVRt documentation.
``revrt._rust``.

reV
NREL's Renewable Energy Potential platform that models generation
NLR's Renewable Energy Potential platform that models generation
profiles for renewable resources. reVRt complements reV by adding
transmission routing capabilities that feed downstream analyses.

Expand All @@ -128,11 +128,6 @@ supporting technologies referenced throughout the reVRt documentation.
simulations, and exports supporting analytics for transmission
planning studies.

reVX
NREL's valuation framework that builds on reV outputs to assess
market and financial metrics. reVRt outputs can flow into reVX to
inform siting and transmission decisions.

routing file
HDF5 file produced by the cost preparation pipeline that stores
coordinate grids, friction and barrier layers, metadata, and any
Expand Down
2 changes: 1 addition & 1 deletion pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "maturin"
[project]
name = "NREL-reVRt"
version = "0.2.1"
description = "National Renewable Energy Laboratory's (NREL's) Transmission for reVX tool"
description = "National Laboratory of the Rockies' (NLR's) Transmission for reVX tool"
readme = "README.rst"
authors = [
{name = "Guilherme Castelão", email = "[email protected]"},
Expand All @@ -16,7 +16,7 @@ maintainers = [
{name = "Paul Pinchuk", email = "[email protected]"},
]
license = {text = "BSD-3-Clause"}
keywords = ["NREL", "routing", "transmission", "reVRt", "reV", "reVX"]
keywords = ["NLR", "routing", "transmission", "reVRt", "reV", "reVX"]
requires-python = ">= 3.11"
classifiers=[
"Development Status :: 2 - Pre-Alpha",
Expand Down
2 changes: 1 addition & 1 deletion revrt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Routing analysis library for the reV model"""
"""Routing analysis library"""

import importlib.metadata

Expand Down
2 changes: 2 additions & 0 deletions revrt/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from revrt import __version__
from revrt.spatial_characterization.cli import route_characterizations_command
from revrt.costs.cli import build_routing_layers_command
from revrt.routing.cli import route_points_command
from revrt.utilities.cli import (
layers_to_file_command,
layers_from_file_command,
Expand All @@ -21,6 +22,7 @@
layers_from_file_command,
build_routing_layers_command,
route_characterizations_command,
route_points_command,
]
main = make_cli(commands, info={"name": "reVRt", "version": __version__})

Expand Down
4 changes: 3 additions & 1 deletion revrt/costs/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self, config=None):
config : str or dict, optional
Dictionary of transmission cost configuration values, or
path to JSON/JSON5 file containing this dictionary. The
dictionary should have the following keys:
dictionary should have a subset of the following keys:

- base_line_costs
- iso_lookup
Expand All @@ -65,6 +65,8 @@ def __init__(self, config=None):
- power_to_voltage
- transformer_costs
- upgrade_substation_costs
- voltage_polarity_mult
- row_width

Each of these keys should point to another dictionary or
path to JSON/JSON5 file containing a dictionary of
Expand Down
12 changes: 11 additions & 1 deletion revrt/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ def __init__(self, *args, **kwargs):
"""Init exception and broadcast message to logger"""
super().__init__(*args, **kwargs)
if args:
logger.error(str(args[0]), stacklevel=2)
logger.error(
"<%s> %s", self.__class__.__name__, args[0], stacklevel=2
)


class revrtAttributeError(revrtError, AttributeError):
Expand All @@ -33,10 +35,18 @@ class revrtFileNotFoundError(revrtError, FileNotFoundError):
"""revrt FileNotFoundError"""


class revrtInvalidStartCostError(revrtError, ValueError):
"""revrt InvalidStartCostError"""


class revrtKeyError(revrtError, KeyError):
"""revrt KeyError"""


class revrtLeastCostPathNotFoundError(revrtError, RuntimeError):
"""revrt LeastCostPathNotFoundError"""


class revrtNotImplementedError(revrtError, NotImplementedError):
"""revrt NotImplementedError"""

Expand Down
1 change: 1 addition & 0 deletions revrt/routing/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""reVRt routing logic"""
Loading
Loading