Skip to content
Merged
4 changes: 2 additions & 2 deletions src/graph/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ fn prepare_commodities_graph_for_validation(
filtered_graph
}

/// Checks if a process can be active for a particular timeslice in a given year and region
/// Checks if a process can be active for a particular time slice in a given year and region
///
/// It considers all commission years that can lead to a running process in the target region and
/// year, accounting for the process lifetime, and then checks if, for any of those, the process
/// is active in the required timeslice. In other words, this checks if there is the _possibility_
/// is active in the required time slice. In other words, this checks if there is the _possibility_
/// of having an active process, although there is no guarantee of that happening since it depends
/// on the investment.
fn can_be_active(
Expand Down
18 changes: 9 additions & 9 deletions src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ impl ActivityLimits {
let lower = *ts_limit.start();
let mut upper = *ts_limit.end();

// If there's a seasonal/annual limit, we must cap the timeslice limit to ensure that it
// If there's a seasonal/annual limit, we must cap the time slice limit to ensure that it
// doesn't exceed the upper bound of the season/year
if let Some(seasonal_limit) = self.seasonal_limits.get(&time_slice.season) {
upper = upper.min(*seasonal_limit.end());
Expand Down Expand Up @@ -356,7 +356,7 @@ impl ActivityLimits {

/// Iterate over all limits
///
/// This first iterates over all individual timeslice limits, followed by seasonal limits (if
/// This first iterates over all individual time slice limits, followed by seasonal limits (if
/// any), and finally the annual limit (if any).
pub fn iter_limits(
&self,
Expand Down Expand Up @@ -1030,10 +1030,10 @@ mod tests {
fn new_with_full_availability(time_slice_info2: TimeSliceInfo) {
let limits = ActivityLimits::new_with_full_availability(&time_slice_info2);

// Each timeslice from the info should be present in the limits
// Each time slice from the info should be present in the limits
for (ts_id, ts_len) in time_slice_info2.iter() {
let l = limits.get_limit_for_time_slice(ts_id);
// Lower bound should be zero and upper bound equal to timeslice length
// Lower bound should be zero and upper bound equal to time slice length
assert_eq!(*l.start(), Dimensionless(0.0));
assert_eq!(*l.end(), Dimensionless(ts_len.value()));
}
Expand All @@ -1048,15 +1048,15 @@ mod tests {
fn new_from_limits_with_seasonal_limit_applied(time_slice_info2: TimeSliceInfo) {
let mut limits = HashMap::new();

// Set a seasonal upper limit that is stricter than the sum of timeslices
// Set a seasonal upper limit that is stricter than the sum of time slices
limits.insert(
TimeSliceSelection::Season("winter".into()),
Dimensionless(0.0)..=Dimensionless(0.01),
);

let result = ActivityLimits::new_from_limits(&limits, &time_slice_info2).unwrap();

// Each timeslice upper bound should be capped by the seasonal upper bound (0.01)
// Each time slice upper bound should be capped by the seasonal upper bound (0.01)
for (ts_id, _ts_len) in time_slice_info2.iter() {
let ts_limit = result.get_limit_for_time_slice(ts_id);
assert_eq!(*ts_limit.end(), Dimensionless(0.01));
Expand All @@ -1071,15 +1071,15 @@ mod tests {
fn new_from_limits_with_annual_limit_applied(time_slice_info2: TimeSliceInfo) {
let mut limits = HashMap::new();

// Set an annual upper limit that is stricter than the sum of timeslices
// Set an annual upper limit that is stricter than the sum of time slices
limits.insert(
TimeSliceSelection::Annual,
Dimensionless(0.0)..=Dimensionless(0.01),
);

let result = ActivityLimits::new_from_limits(&limits, &time_slice_info2).unwrap();

// Each timeslice upper bound should be capped by the annual upper bound (0.01)
// Each time slice upper bound should be capped by the annual upper bound (0.01)
for (ts_id, _ts_len) in time_slice_info2.iter() {
let ts_limit = result.get_limit_for_time_slice(ts_id);
assert_eq!(*ts_limit.end(), Dimensionless(0.01));
Expand All @@ -1098,7 +1098,7 @@ mod tests {
fn new_from_limits_missing_timeslices_error(time_slice_info2: TimeSliceInfo) {
let mut limits = HashMap::new();

// Add a single timeslice limit but do not provide limits for all timeslices
// Add a single time slice limit but do not provide limits for all time slices
let first_ts = time_slice_info2.iter().next().unwrap().0.clone();
limits.insert(
TimeSliceSelection::Single(first_ts),
Expand Down
Loading
Loading