Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/core_tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@ on:
pull_request:
branches:
- '*'

workflow_dispatch:

env:
Expand DownExpand Up@@ -455,7 +455,7 @@ jobs:

develop-docbuild:
needs: foundation
if: github.ref_name == 'main'
if: github.ref_name == 'main' || github.ref_name == 'docs-fix'
name: develop-docbuild
runs-on: ubuntu-latest
permissions:
Expand Down
3 changes: 0 additions & 3 deletions activitysim/abm/misc.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,7 +18,6 @@

@workflow.cached_object
def households_sample_size(state: workflow.State, override_hh_ids) -> int:

if override_hh_ids is None:
return state.settings.households_sample_size
else:
Expand All@@ -27,7 +26,6 @@ def households_sample_size(state: workflow.State, override_hh_ids) -> int:

@workflow.cached_object
def override_hh_ids(state: workflow.State) -> np.ndarray | None:

hh_ids_filename = state.settings.hh_ids
if hh_ids_filename is None:
return None
Expand DownExpand Up@@ -65,7 +63,6 @@ def override_hh_ids(state: workflow.State) -> np.ndarray | None:

@workflow.cached_object
def trace_od(state: workflow.State) -> tuple[int, int] | None:

od = state.settings.trace_od

if od and not (
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/auto_ownership.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -72,7 +72,6 @@ def auto_ownership_simulate(
# - preprocessor
preprocessor_settings = model_settings.preprocessor
if preprocessor_settings:

locals_d = {}
if constants is not None:
locals_d.update(constants)
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/initialize.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,7 +148,6 @@ def initialize_households(
model_settings_file_name: str = "initialize_households.yaml",
trace_label: str = "initialize_households",
) -> None:

with chunk.chunk_log(state, trace_label, base=True) as chunk_sizer:
chunk_sizer.log_rss(f"{trace_label}.inside-yield")

Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/input_checker.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -209,7 +209,6 @@ class HouseholdValidator(pydantic.BaseModel) list_of_households...


def report_errors(state, input_checker_settings, v_warnings, v_errors):

# logging overall statistics first before printing details
for table_settings in input_checker_settings["table_list"]:
table_name = table_settings["name"]
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/non_mandatory_tour_frequency.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -236,7 +236,6 @@ def non_mandatory_tour_frequency(
# - preprocessor
preprocessor_settings = model_settings.preprocessor
if preprocessor_settings:

locals_dict = {
"person_max_window": lambda x: person_max_window(state, x),
"person_available_periods": lambda persons, start_bin, end_bin, continuous: person_available_periods(
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/trip_purpose_and_destination.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,7 +69,6 @@ def trip_purpose_and_destination(
model_settings_file_name: str = "trip_purpose_and_destination.yaml",
trace_label: str = "trip_purpose_and_destination",
) -> None:

if model_settings is None:
model_settings = TripPurposeAndDestinationSettings.read_settings_file(
state.filesystem,
Expand Down
2 changes: 0 additions & 2 deletions activitysim/abm/models/trip_scheduling_choice.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -358,7 +358,6 @@ def trip_scheduling_choice(
model_settings_file_name: str = "trip_scheduling_choice.yaml",
trace_label: str = "trip_scheduling_choice",
) -> None:

if model_settings is None:
model_settings = TripSchedulingChoiceSettings.read_settings_file(
state.filesystem,
Expand DownExpand Up@@ -416,7 +415,6 @@ def trip_scheduling_choice(
}

if preprocessor_settings:

simulate.set_skim_wrapper_targets(tours_df, skims)

expressions.assign_columns(
Expand Down
4 changes: 0 additions & 4 deletions activitysim/abm/models/util/cdap.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -297,7 +297,6 @@ def cached_joint_spec_name(hhsize):


def get_cached_spec(state: workflow.State, hhsize):

spec_name = cached_spec_name(hhsize)

spec = state.get_injectable(spec_name, None)
Expand All@@ -319,7 +318,6 @@ def get_cached_spec(state: workflow.State, hhsize):


def get_cached_joint_spec(state: workflow.State, hhsize):

spec_name = cached_joint_spec_name(hhsize)

spec = state.get_injectable(spec_name, None)
Expand DownExpand Up@@ -625,7 +623,6 @@ def build_cdap_joint_spec(
# N_p1 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0
for pnum in range(1, hhsize + 1):
for activity in ["M", "N", "H"]:

new_row_index = len(spec)
spec.loc[new_row_index, expression_name] = add_pn(activity, pnum)

Expand All@@ -638,7 +635,6 @@ def build_cdap_joint_spec(

# for each row in the joint util table
for row in joint_tour_coefficients.itertuples():

# if there is no dependencies
if row.dependency is np.nan:
expression = row.Expression
Expand Down
4 changes: 0 additions & 4 deletions activitysim/abm/models/util/overlap.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -138,7 +138,6 @@ def p2p_time_window_overlap(state: workflow.State, p1_ids, p2_ids):


def person_pairs(persons):

p = persons[["household_id", "adult"]].reset_index()
p2p = pd.merge(p, p, left_on="household_id", right_on="household_id", how="outer")

Expand DownExpand Up@@ -166,7 +165,6 @@ def person_pairs(persons):


def hh_time_window_overlap(state: workflow.State, households, persons):

p2p = person_pairs(persons)

p2p["max_overlap"] = p2p_time_window_overlap(state, p2p.person1, p2p.person2)
Expand All@@ -189,7 +187,6 @@ def hh_time_window_overlap(state: workflow.State, households, persons):


def person_time_window_overlap(state: workflow.State, persons):

p2p = person_pairs(persons)

p2p["max_overlap"] = p2p_time_window_overlap(state, p2p.person1, p2p.person2)
Expand DownExpand Up@@ -224,7 +221,6 @@ def person_time_window_overlap(state: workflow.State, persons):


def person_max_window(state: workflow.State, persons):

timetable = state.get_injectable("timetable")

# ndarray with one row per person and one column per time period
Expand Down
5 changes: 0 additions & 5 deletions activitysim/abm/models/util/probabilistic_scheduling.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -93,7 +93,6 @@ def _report_bad_choices(
# log the indexes of the first MAX_PRINT offending rows
MAX_PRINT = 0
for idx in df.index[:MAX_PRINT].values:

row_msg = "%s : failed %s = %s (hh_id = %s)" % (
trace_label,
df.index.name,
Expand All@@ -113,7 +112,6 @@ def _preprocess_departure_probs(
depart_alt_base,
first_trip_in_leg,
):

# zero out probs outside earliest-latest window if one exists
probs_cols = [c for c in probs_spec.columns if c not in probs_join_cols]
if clip_earliest_latest:
Expand All@@ -129,7 +127,6 @@ def _preprocess_departure_probs(


def _preprocess_stop_duration_probs(choosers):

# convert wide to long. duration probs are stored in long format so that
# inbound/outbound duration probs, which both have a 0 alternative, can be
# stored in a single config file. open to better suggestions here.
Expand DownExpand Up@@ -203,7 +200,6 @@ def _preprocess_scheduling_probs(
def _postprocess_scheduling_choices(
scheduling_mode, depart_alt_base, choices, choice_cols, choosers
):

"""
This method just converts the choice column indexes returned by the
logit.make_choices() method into actual departure time values that are
Expand All@@ -222,7 +218,6 @@ def _postprocess_scheduling_choices(
# get applied to trip-specific departure and arrival times, so depart_alt_base
# is a column/series rather than a scalar.
if scheduling_mode == "stop_duration":

# for outbound trips, offsets get added to the departure time constraint
if choosers.outbound.all():
depart_alt_base = choosers["earliest"]
Expand Down
8 changes: 2 additions & 6 deletions activitysim/abm/models/util/test/test_input_checker.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,11 +7,11 @@

import pandas as pd
import pandas.testing as pdt
import pandera as pa
import pytest
import yaml
import pandera as pa

from activitysim.abm.models.input_checker import validate_with_pandera, TABLE_STORE
from activitysim.abm.models.input_checker import TABLE_STORE, validate_with_pandera


@pytest.fixture(scope="class")
Expand DownExpand Up@@ -56,7 +56,6 @@ def households():


def test_passing_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -83,7 +82,6 @@ def dummy_example(cls, households: pd.DataFrame):


def test_error_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -107,7 +105,6 @@ class Household(pa.DataFrameModel):


def test_warning_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -132,7 +129,6 @@ class Household(pa.DataFrameModel):
def test_custom_check_failure_dataframe(
households, v_errors, v_warnings, validation_settings
):

TABLE_STORE["households"] = households

class input_checker:
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/util/trip.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,6 @@


def failed_trip_cohorts(trips, failed):

# outbound trips in a tour with a failed outbound trip
bad_outbound_trips = trips.outbound & (
trips.tour_id.isin(trips.tour_id[failed & trips.outbound])
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/tables/households.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -127,7 +127,6 @@ def households_merged(
land_use: pd.DataFrame,
accessibility: pd.DataFrame,
) -> pd.DataFrame:

households = simple_table_join(
households,
land_use,
Expand Down
2 changes: 0 additions & 2 deletions activitysim/abm/tables/table_dict.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,13 +18,11 @@

@workflow.cached_object
def rng_channels(state: workflow.State):

return cid.RANDOM_CHANNELS


@workflow.cached_object
def traceable_tables(state: workflow.State):

# names of all traceable tables ordered by dependency on household_id
# e.g. 'persons' has to be registered AFTER 'households'

Expand Down
4 changes: 2 additions & 2 deletions activitysim/abm/test/run_multi_zone_mp.py
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

# ActivitySim
# See full license in LICENSE.txt.
import os
Expand All@@ -13,7 +15,6 @@


def test_mp_run():

configs_dir = [example_path("configs_3_zone"), example_path("configs")]
data_dir = example_path("data_3")

Expand All@@ -34,5 +35,4 @@ def test_mp_run():


if __name__ == "__main__":

test_mp_run()
2 changes: 0 additions & 2 deletions activitysim/abm/test/test_misc/setup_utils.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,6 @@ def example_path(dirname):


def setup_dirs(ancillary_configs_dir=None, data_dir=None):

# ancillary_configs_dir is used by run_mp to test multiprocess

# test_pipeline_configs_dir = os.path.join(os.path.dirname(__file__), "configs")
Expand DownExpand Up@@ -69,7 +68,6 @@ def setup_dirs(ancillary_configs_dir=None, data_dir=None):


def close_handlers():

loggers = logging.Logger.manager.loggerDict
for name in loggers:
logger = logging.getLogger(name)
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/core_tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@ on:
pull_request:
branches:
- '*'

workflow_dispatch:

env:
Expand DownExpand Up@@ -455,7 +455,7 @@ jobs:

develop-docbuild:
needs: foundation
if: github.ref_name == 'main'
if: github.ref_name == 'main' || github.ref_name == 'docs-fix'
name: develop-docbuild
runs-on: ubuntu-latest
permissions:
Expand Down
3 changes: 0 additions & 3 deletions activitysim/abm/misc.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,7 +18,6 @@

@workflow.cached_object
def households_sample_size(state: workflow.State, override_hh_ids) -> int:

if override_hh_ids is None:
return state.settings.households_sample_size
else:
Expand All@@ -27,7 +26,6 @@ def households_sample_size(state: workflow.State, override_hh_ids) -> int:

@workflow.cached_object
def override_hh_ids(state: workflow.State) -> np.ndarray | None:

hh_ids_filename = state.settings.hh_ids
if hh_ids_filename is None:
return None
Expand DownExpand Up@@ -65,7 +63,6 @@ def override_hh_ids(state: workflow.State) -> np.ndarray | None:

@workflow.cached_object
def trace_od(state: workflow.State) -> tuple[int, int] | None:

od = state.settings.trace_od

if od and not (
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/auto_ownership.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -72,7 +72,6 @@ def auto_ownership_simulate(
# - preprocessor
preprocessor_settings = model_settings.preprocessor
if preprocessor_settings:

locals_d = {}
if constants is not None:
locals_d.update(constants)
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/initialize.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,7 +148,6 @@ def initialize_households(
model_settings_file_name: str = "initialize_households.yaml",
trace_label: str = "initialize_households",
) -> None:

with chunk.chunk_log(state, trace_label, base=True) as chunk_sizer:
chunk_sizer.log_rss(f"{trace_label}.inside-yield")

Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/input_checker.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -209,7 +209,6 @@ class HouseholdValidator(pydantic.BaseModel) list_of_households...


def report_errors(state, input_checker_settings, v_warnings, v_errors):

# logging overall statistics first before printing details
for table_settings in input_checker_settings["table_list"]:
table_name = table_settings["name"]
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/non_mandatory_tour_frequency.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -236,7 +236,6 @@ def non_mandatory_tour_frequency(
# - preprocessor
preprocessor_settings = model_settings.preprocessor
if preprocessor_settings:

locals_dict = {
"person_max_window": lambda x: person_max_window(state, x),
"person_available_periods": lambda persons, start_bin, end_bin, continuous: person_available_periods(
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/trip_purpose_and_destination.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,7 +69,6 @@ def trip_purpose_and_destination(
model_settings_file_name: str = "trip_purpose_and_destination.yaml",
trace_label: str = "trip_purpose_and_destination",
) -> None:

if model_settings is None:
model_settings = TripPurposeAndDestinationSettings.read_settings_file(
state.filesystem,
Expand Down
2 changes: 0 additions & 2 deletions activitysim/abm/models/trip_scheduling_choice.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -358,7 +358,6 @@ def trip_scheduling_choice(
model_settings_file_name: str = "trip_scheduling_choice.yaml",
trace_label: str = "trip_scheduling_choice",
) -> None:

if model_settings is None:
model_settings = TripSchedulingChoiceSettings.read_settings_file(
state.filesystem,
Expand DownExpand Up@@ -416,7 +415,6 @@ def trip_scheduling_choice(
}

if preprocessor_settings:

simulate.set_skim_wrapper_targets(tours_df, skims)

expressions.assign_columns(
Expand Down
4 changes: 0 additions & 4 deletions activitysim/abm/models/util/cdap.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -297,7 +297,6 @@ def cached_joint_spec_name(hhsize):


def get_cached_spec(state: workflow.State, hhsize):

spec_name = cached_spec_name(hhsize)

spec = state.get_injectable(spec_name, None)
Expand All@@ -319,7 +318,6 @@ def get_cached_spec(state: workflow.State, hhsize):


def get_cached_joint_spec(state: workflow.State, hhsize):

spec_name = cached_joint_spec_name(hhsize)

spec = state.get_injectable(spec_name, None)
Expand DownExpand Up@@ -625,7 +623,6 @@ def build_cdap_joint_spec(
# N_p1 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0
for pnum in range(1, hhsize + 1):
for activity in ["M", "N", "H"]:

new_row_index = len(spec)
spec.loc[new_row_index, expression_name] = add_pn(activity, pnum)

Expand All@@ -638,7 +635,6 @@ def build_cdap_joint_spec(

# for each row in the joint util table
for row in joint_tour_coefficients.itertuples():

# if there is no dependencies
if row.dependency is np.nan:
expression = row.Expression
Expand Down
4 changes: 0 additions & 4 deletions activitysim/abm/models/util/overlap.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -138,7 +138,6 @@ def p2p_time_window_overlap(state: workflow.State, p1_ids, p2_ids):


def person_pairs(persons):

p = persons[["household_id", "adult"]].reset_index()
p2p = pd.merge(p, p, left_on="household_id", right_on="household_id", how="outer")

Expand DownExpand Up@@ -166,7 +165,6 @@ def person_pairs(persons):


def hh_time_window_overlap(state: workflow.State, households, persons):

p2p = person_pairs(persons)

p2p["max_overlap"] = p2p_time_window_overlap(state, p2p.person1, p2p.person2)
Expand All@@ -189,7 +187,6 @@ def hh_time_window_overlap(state: workflow.State, households, persons):


def person_time_window_overlap(state: workflow.State, persons):

p2p = person_pairs(persons)

p2p["max_overlap"] = p2p_time_window_overlap(state, p2p.person1, p2p.person2)
Expand DownExpand Up@@ -224,7 +221,6 @@ def person_time_window_overlap(state: workflow.State, persons):


def person_max_window(state: workflow.State, persons):

timetable = state.get_injectable("timetable")

# ndarray with one row per person and one column per time period
Expand Down
5 changes: 0 additions & 5 deletions activitysim/abm/models/util/probabilistic_scheduling.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -93,7 +93,6 @@ def _report_bad_choices(
# log the indexes of the first MAX_PRINT offending rows
MAX_PRINT = 0
for idx in df.index[:MAX_PRINT].values:

row_msg = "%s : failed %s = %s (hh_id = %s)" % (
trace_label,
df.index.name,
Expand All@@ -113,7 +112,6 @@ def _preprocess_departure_probs(
depart_alt_base,
first_trip_in_leg,
):

# zero out probs outside earliest-latest window if one exists
probs_cols = [c for c in probs_spec.columns if c not in probs_join_cols]
if clip_earliest_latest:
Expand All@@ -129,7 +127,6 @@ def _preprocess_departure_probs(


def _preprocess_stop_duration_probs(choosers):

# convert wide to long. duration probs are stored in long format so that
# inbound/outbound duration probs, which both have a 0 alternative, can be
# stored in a single config file. open to better suggestions here.
Expand DownExpand Up@@ -203,7 +200,6 @@ def _preprocess_scheduling_probs(
def _postprocess_scheduling_choices(
scheduling_mode, depart_alt_base, choices, choice_cols, choosers
):

"""
This method just converts the choice column indexes returned by the
logit.make_choices() method into actual departure time values that are
Expand All@@ -222,7 +218,6 @@ def _postprocess_scheduling_choices(
# get applied to trip-specific departure and arrival times, so depart_alt_base
# is a column/series rather than a scalar.
if scheduling_mode == "stop_duration":

# for outbound trips, offsets get added to the departure time constraint
if choosers.outbound.all():
depart_alt_base = choosers["earliest"]
Expand Down
8 changes: 2 additions & 6 deletions activitysim/abm/models/util/test/test_input_checker.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,11 +7,11 @@

import pandas as pd
import pandas.testing as pdt
import pandera as pa
import pytest
import yaml
import pandera as pa

from activitysim.abm.models.input_checker import validate_with_pandera, TABLE_STORE
from activitysim.abm.models.input_checker import TABLE_STORE, validate_with_pandera


@pytest.fixture(scope="class")
Expand DownExpand Up@@ -56,7 +56,6 @@ def households():


def test_passing_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -83,7 +82,6 @@ def dummy_example(cls, households: pd.DataFrame):


def test_error_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -107,7 +105,6 @@ class Household(pa.DataFrameModel):


def test_warning_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -132,7 +129,6 @@ class Household(pa.DataFrameModel):
def test_custom_check_failure_dataframe(
households, v_errors, v_warnings, validation_settings
):

TABLE_STORE["households"] = households

class input_checker:
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/util/trip.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,6 @@


def failed_trip_cohorts(trips, failed):

# outbound trips in a tour with a failed outbound trip
bad_outbound_trips = trips.outbound & (
trips.tour_id.isin(trips.tour_id[failed & trips.outbound])
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/tables/households.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -127,7 +127,6 @@ def households_merged(
land_use: pd.DataFrame,
accessibility: pd.DataFrame,
) -> pd.DataFrame:

households = simple_table_join(
households,
land_use,
Expand Down
2 changes: 0 additions & 2 deletions activitysim/abm/tables/table_dict.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,13 +18,11 @@

@workflow.cached_object
def rng_channels(state: workflow.State):

return cid.RANDOM_CHANNELS


@workflow.cached_object
def traceable_tables(state: workflow.State):

# names of all traceable tables ordered by dependency on household_id
# e.g. 'persons' has to be registered AFTER 'households'

Expand Down
4 changes: 2 additions & 2 deletions activitysim/abm/test/run_multi_zone_mp.py
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

# ActivitySim
# See full license in LICENSE.txt.
import os
Expand All@@ -13,7 +15,6 @@


def test_mp_run():

configs_dir = [example_path("configs_3_zone"), example_path("configs")]
data_dir = example_path("data_3")

Expand All@@ -34,5 +35,4 @@ def test_mp_run():


if __name__ == "__main__":

test_mp_run()
2 changes: 0 additions & 2 deletions activitysim/abm/test/test_misc/setup_utils.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,6 @@ def example_path(dirname):


def setup_dirs(ancillary_configs_dir=None, data_dir=None):

# ancillary_configs_dir is used by run_mp to test multiprocess

# test_pipeline_configs_dir = os.path.join(os.path.dirname(__file__), "configs")
Expand DownExpand Up@@ -69,7 +68,6 @@ def setup_dirs(ancillary_configs_dir=None, data_dir=None):


def close_handlers():

loggers = logging.Logger.manager.loggerDict
for name in loggers:
logger = logging.getLogger(name)
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/core_tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@ on:
pull_request:
branches:
- '*'

workflow_dispatch:

env:
Expand DownExpand Up@@ -455,7 +455,7 @@ jobs:

develop-docbuild:
needs: foundation
if: github.ref_name == 'main'
if: github.ref_name == 'main' || github.ref_name == 'docs-fix'
name: develop-docbuild
runs-on: ubuntu-latest
permissions:
Expand Down
3 changes: 0 additions & 3 deletions activitysim/abm/misc.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,7 +18,6 @@

@workflow.cached_object
def households_sample_size(state: workflow.State, override_hh_ids) -> int:

if override_hh_ids is None:
return state.settings.households_sample_size
else:
Expand All@@ -27,7 +26,6 @@ def households_sample_size(state: workflow.State, override_hh_ids) -> int:

@workflow.cached_object
def override_hh_ids(state: workflow.State) -> np.ndarray | None:

hh_ids_filename = state.settings.hh_ids
if hh_ids_filename is None:
return None
Expand DownExpand Up@@ -65,7 +63,6 @@ def override_hh_ids(state: workflow.State) -> np.ndarray | None:

@workflow.cached_object
def trace_od(state: workflow.State) -> tuple[int, int] | None:

od = state.settings.trace_od

if od and not (
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/auto_ownership.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -72,7 +72,6 @@ def auto_ownership_simulate(
# - preprocessor
preprocessor_settings = model_settings.preprocessor
if preprocessor_settings:

locals_d = {}
if constants is not None:
locals_d.update(constants)
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/initialize.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,7 +148,6 @@ def initialize_households(
model_settings_file_name: str = "initialize_households.yaml",
trace_label: str = "initialize_households",
) -> None:

with chunk.chunk_log(state, trace_label, base=True) as chunk_sizer:
chunk_sizer.log_rss(f"{trace_label}.inside-yield")

Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/input_checker.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -209,7 +209,6 @@ class HouseholdValidator(pydantic.BaseModel) list_of_households...


def report_errors(state, input_checker_settings, v_warnings, v_errors):

# logging overall statistics first before printing details
for table_settings in input_checker_settings["table_list"]:
table_name = table_settings["name"]
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/non_mandatory_tour_frequency.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -236,7 +236,6 @@ def non_mandatory_tour_frequency(
# - preprocessor
preprocessor_settings = model_settings.preprocessor
if preprocessor_settings:

locals_dict = {
"person_max_window": lambda x: person_max_window(state, x),
"person_available_periods": lambda persons, start_bin, end_bin, continuous: person_available_periods(
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/trip_purpose_and_destination.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,7 +69,6 @@ def trip_purpose_and_destination(
model_settings_file_name: str = "trip_purpose_and_destination.yaml",
trace_label: str = "trip_purpose_and_destination",
) -> None:

if model_settings is None:
model_settings = TripPurposeAndDestinationSettings.read_settings_file(
state.filesystem,
Expand Down
2 changes: 0 additions & 2 deletions activitysim/abm/models/trip_scheduling_choice.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -358,7 +358,6 @@ def trip_scheduling_choice(
model_settings_file_name: str = "trip_scheduling_choice.yaml",
trace_label: str = "trip_scheduling_choice",
) -> None:

if model_settings is None:
model_settings = TripSchedulingChoiceSettings.read_settings_file(
state.filesystem,
Expand DownExpand Up@@ -416,7 +415,6 @@ def trip_scheduling_choice(
}

if preprocessor_settings:

simulate.set_skim_wrapper_targets(tours_df, skims)

expressions.assign_columns(
Expand Down
4 changes: 0 additions & 4 deletions activitysim/abm/models/util/cdap.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -297,7 +297,6 @@ def cached_joint_spec_name(hhsize):


def get_cached_spec(state: workflow.State, hhsize):

spec_name = cached_spec_name(hhsize)

spec = state.get_injectable(spec_name, None)
Expand All@@ -319,7 +318,6 @@ def get_cached_spec(state: workflow.State, hhsize):


def get_cached_joint_spec(state: workflow.State, hhsize):

spec_name = cached_joint_spec_name(hhsize)

spec = state.get_injectable(spec_name, None)
Expand DownExpand Up@@ -625,7 +623,6 @@ def build_cdap_joint_spec(
# N_p1 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0
for pnum in range(1, hhsize + 1):
for activity in ["M", "N", "H"]:

new_row_index = len(spec)
spec.loc[new_row_index, expression_name] = add_pn(activity, pnum)

Expand All@@ -638,7 +635,6 @@ def build_cdap_joint_spec(

# for each row in the joint util table
for row in joint_tour_coefficients.itertuples():

# if there is no dependencies
if row.dependency is np.nan:
expression = row.Expression
Expand Down
4 changes: 0 additions & 4 deletions activitysim/abm/models/util/overlap.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -138,7 +138,6 @@ def p2p_time_window_overlap(state: workflow.State, p1_ids, p2_ids):


def person_pairs(persons):

p = persons[["household_id", "adult"]].reset_index()
p2p = pd.merge(p, p, left_on="household_id", right_on="household_id", how="outer")

Expand DownExpand Up@@ -166,7 +165,6 @@ def person_pairs(persons):


def hh_time_window_overlap(state: workflow.State, households, persons):

p2p = person_pairs(persons)

p2p["max_overlap"] = p2p_time_window_overlap(state, p2p.person1, p2p.person2)
Expand All@@ -189,7 +187,6 @@ def hh_time_window_overlap(state: workflow.State, households, persons):


def person_time_window_overlap(state: workflow.State, persons):

p2p = person_pairs(persons)

p2p["max_overlap"] = p2p_time_window_overlap(state, p2p.person1, p2p.person2)
Expand DownExpand Up@@ -224,7 +221,6 @@ def person_time_window_overlap(state: workflow.State, persons):


def person_max_window(state: workflow.State, persons):

timetable = state.get_injectable("timetable")

# ndarray with one row per person and one column per time period
Expand Down
5 changes: 0 additions & 5 deletions activitysim/abm/models/util/probabilistic_scheduling.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -93,7 +93,6 @@ def _report_bad_choices(
# log the indexes of the first MAX_PRINT offending rows
MAX_PRINT = 0
for idx in df.index[:MAX_PRINT].values:

row_msg = "%s : failed %s = %s (hh_id = %s)" % (
trace_label,
df.index.name,
Expand All@@ -113,7 +112,6 @@ def _preprocess_departure_probs(
depart_alt_base,
first_trip_in_leg,
):

# zero out probs outside earliest-latest window if one exists
probs_cols = [c for c in probs_spec.columns if c not in probs_join_cols]
if clip_earliest_latest:
Expand All@@ -129,7 +127,6 @@ def _preprocess_departure_probs(


def _preprocess_stop_duration_probs(choosers):

# convert wide to long. duration probs are stored in long format so that
# inbound/outbound duration probs, which both have a 0 alternative, can be
# stored in a single config file. open to better suggestions here.
Expand DownExpand Up@@ -203,7 +200,6 @@ def _preprocess_scheduling_probs(
def _postprocess_scheduling_choices(
scheduling_mode, depart_alt_base, choices, choice_cols, choosers
):

"""
This method just converts the choice column indexes returned by the
logit.make_choices() method into actual departure time values that are
Expand All@@ -222,7 +218,6 @@ def _postprocess_scheduling_choices(
# get applied to trip-specific departure and arrival times, so depart_alt_base
# is a column/series rather than a scalar.
if scheduling_mode == "stop_duration":

# for outbound trips, offsets get added to the departure time constraint
if choosers.outbound.all():
depart_alt_base = choosers["earliest"]
Expand Down
8 changes: 2 additions & 6 deletions activitysim/abm/models/util/test/test_input_checker.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,11 +7,11 @@

import pandas as pd
import pandas.testing as pdt
import pandera as pa
import pytest
import yaml
import pandera as pa

from activitysim.abm.models.input_checker import validate_with_pandera, TABLE_STORE
from activitysim.abm.models.input_checker import TABLE_STORE, validate_with_pandera


@pytest.fixture(scope="class")
Expand DownExpand Up@@ -56,7 +56,6 @@ def households():


def test_passing_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -83,7 +82,6 @@ def dummy_example(cls, households: pd.DataFrame):


def test_error_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -107,7 +105,6 @@ class Household(pa.DataFrameModel):


def test_warning_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -132,7 +129,6 @@ class Household(pa.DataFrameModel):
def test_custom_check_failure_dataframe(
households, v_errors, v_warnings, validation_settings
):

TABLE_STORE["households"] = households

class input_checker:
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/util/trip.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,6 @@


def failed_trip_cohorts(trips, failed):

# outbound trips in a tour with a failed outbound trip
bad_outbound_trips = trips.outbound & (
trips.tour_id.isin(trips.tour_id[failed & trips.outbound])
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/tables/households.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -127,7 +127,6 @@ def households_merged(
land_use: pd.DataFrame,
accessibility: pd.DataFrame,
) -> pd.DataFrame:

households = simple_table_join(
households,
land_use,
Expand Down
2 changes: 0 additions & 2 deletions activitysim/abm/tables/table_dict.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,13 +18,11 @@

@workflow.cached_object
def rng_channels(state: workflow.State):

return cid.RANDOM_CHANNELS


@workflow.cached_object
def traceable_tables(state: workflow.State):

# names of all traceable tables ordered by dependency on household_id
# e.g. 'persons' has to be registered AFTER 'households'

Expand Down
4 changes: 2 additions & 2 deletions activitysim/abm/test/run_multi_zone_mp.py
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

# ActivitySim
# See full license in LICENSE.txt.
import os
Expand All@@ -13,7 +15,6 @@


def test_mp_run():

configs_dir = [example_path("configs_3_zone"), example_path("configs")]
data_dir = example_path("data_3")

Expand All@@ -34,5 +35,4 @@ def test_mp_run():


if __name__ == "__main__":

test_mp_run()
2 changes: 0 additions & 2 deletions activitysim/abm/test/test_misc/setup_utils.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,6 @@ def example_path(dirname):


def setup_dirs(ancillary_configs_dir=None, data_dir=None):

# ancillary_configs_dir is used by run_mp to test multiprocess

# test_pipeline_configs_dir = os.path.join(os.path.dirname(__file__), "configs")
Expand DownExpand Up@@ -69,7 +68,6 @@ def setup_dirs(ancillary_configs_dir=None, data_dir=None):


def close_handlers():

loggers = logging.Logger.manager.loggerDict
for name in loggers:
logger = logging.getLogger(name)
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/core_tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@ on:
pull_request:
branches:
- '*'

workflow_dispatch:

env:
Expand DownExpand Up@@ -455,7 +455,7 @@ jobs:

develop-docbuild:
needs: foundation
if: github.ref_name == 'main'
if: github.ref_name == 'main' || github.ref_name == 'docs-fix'
name: develop-docbuild
runs-on: ubuntu-latest
permissions:
Expand Down
3 changes: 0 additions & 3 deletions activitysim/abm/misc.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,7 +18,6 @@

@workflow.cached_object
def households_sample_size(state: workflow.State, override_hh_ids) -> int:

if override_hh_ids is None:
return state.settings.households_sample_size
else:
Expand All@@ -27,7 +26,6 @@ def households_sample_size(state: workflow.State, override_hh_ids) -> int:

@workflow.cached_object
def override_hh_ids(state: workflow.State) -> np.ndarray | None:

hh_ids_filename = state.settings.hh_ids
if hh_ids_filename is None:
return None
Expand DownExpand Up@@ -65,7 +63,6 @@ def override_hh_ids(state: workflow.State) -> np.ndarray | None:

@workflow.cached_object
def trace_od(state: workflow.State) -> tuple[int, int] | None:

od = state.settings.trace_od

if od and not (
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/auto_ownership.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -72,7 +72,6 @@ def auto_ownership_simulate(
# - preprocessor
preprocessor_settings = model_settings.preprocessor
if preprocessor_settings:

locals_d = {}
if constants is not None:
locals_d.update(constants)
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/initialize.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,7 +148,6 @@ def initialize_households(
model_settings_file_name: str = "initialize_households.yaml",
trace_label: str = "initialize_households",
) -> None:

with chunk.chunk_log(state, trace_label, base=True) as chunk_sizer:
chunk_sizer.log_rss(f"{trace_label}.inside-yield")

Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/input_checker.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -209,7 +209,6 @@ class HouseholdValidator(pydantic.BaseModel) list_of_households...


def report_errors(state, input_checker_settings, v_warnings, v_errors):

# logging overall statistics first before printing details
for table_settings in input_checker_settings["table_list"]:
table_name = table_settings["name"]
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/non_mandatory_tour_frequency.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -236,7 +236,6 @@ def non_mandatory_tour_frequency(
# - preprocessor
preprocessor_settings = model_settings.preprocessor
if preprocessor_settings:

locals_dict = {
"person_max_window": lambda x: person_max_window(state, x),
"person_available_periods": lambda persons, start_bin, end_bin, continuous: person_available_periods(
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/trip_purpose_and_destination.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,7 +69,6 @@ def trip_purpose_and_destination(
model_settings_file_name: str = "trip_purpose_and_destination.yaml",
trace_label: str = "trip_purpose_and_destination",
) -> None:

if model_settings is None:
model_settings = TripPurposeAndDestinationSettings.read_settings_file(
state.filesystem,
Expand Down
2 changes: 0 additions & 2 deletions activitysim/abm/models/trip_scheduling_choice.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -358,7 +358,6 @@ def trip_scheduling_choice(
model_settings_file_name: str = "trip_scheduling_choice.yaml",
trace_label: str = "trip_scheduling_choice",
) -> None:

if model_settings is None:
model_settings = TripSchedulingChoiceSettings.read_settings_file(
state.filesystem,
Expand DownExpand Up@@ -416,7 +415,6 @@ def trip_scheduling_choice(
}

if preprocessor_settings:

simulate.set_skim_wrapper_targets(tours_df, skims)

expressions.assign_columns(
Expand Down
4 changes: 0 additions & 4 deletions activitysim/abm/models/util/cdap.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -297,7 +297,6 @@ def cached_joint_spec_name(hhsize):


def get_cached_spec(state: workflow.State, hhsize):

spec_name = cached_spec_name(hhsize)

spec = state.get_injectable(spec_name, None)
Expand All@@ -319,7 +318,6 @@ def get_cached_spec(state: workflow.State, hhsize):


def get_cached_joint_spec(state: workflow.State, hhsize):

spec_name = cached_joint_spec_name(hhsize)

spec = state.get_injectable(spec_name, None)
Expand DownExpand Up@@ -625,7 +623,6 @@ def build_cdap_joint_spec(
# N_p1 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0
for pnum in range(1, hhsize + 1):
for activity in ["M", "N", "H"]:

new_row_index = len(spec)
spec.loc[new_row_index, expression_name] = add_pn(activity, pnum)

Expand All@@ -638,7 +635,6 @@ def build_cdap_joint_spec(

# for each row in the joint util table
for row in joint_tour_coefficients.itertuples():

# if there is no dependencies
if row.dependency is np.nan:
expression = row.Expression
Expand Down
4 changes: 0 additions & 4 deletions activitysim/abm/models/util/overlap.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -138,7 +138,6 @@ def p2p_time_window_overlap(state: workflow.State, p1_ids, p2_ids):


def person_pairs(persons):

p = persons[["household_id", "adult"]].reset_index()
p2p = pd.merge(p, p, left_on="household_id", right_on="household_id", how="outer")

Expand DownExpand Up@@ -166,7 +165,6 @@ def person_pairs(persons):


def hh_time_window_overlap(state: workflow.State, households, persons):

p2p = person_pairs(persons)

p2p["max_overlap"] = p2p_time_window_overlap(state, p2p.person1, p2p.person2)
Expand All@@ -189,7 +187,6 @@ def hh_time_window_overlap(state: workflow.State, households, persons):


def person_time_window_overlap(state: workflow.State, persons):

p2p = person_pairs(persons)

p2p["max_overlap"] = p2p_time_window_overlap(state, p2p.person1, p2p.person2)
Expand DownExpand Up@@ -224,7 +221,6 @@ def person_time_window_overlap(state: workflow.State, persons):


def person_max_window(state: workflow.State, persons):

timetable = state.get_injectable("timetable")

# ndarray with one row per person and one column per time period
Expand Down
5 changes: 0 additions & 5 deletions activitysim/abm/models/util/probabilistic_scheduling.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -93,7 +93,6 @@ def _report_bad_choices(
# log the indexes of the first MAX_PRINT offending rows
MAX_PRINT = 0
for idx in df.index[:MAX_PRINT].values:

row_msg = "%s : failed %s = %s (hh_id = %s)" % (
trace_label,
df.index.name,
Expand All@@ -113,7 +112,6 @@ def _preprocess_departure_probs(
depart_alt_base,
first_trip_in_leg,
):

# zero out probs outside earliest-latest window if one exists
probs_cols = [c for c in probs_spec.columns if c not in probs_join_cols]
if clip_earliest_latest:
Expand All@@ -129,7 +127,6 @@ def _preprocess_departure_probs(


def _preprocess_stop_duration_probs(choosers):

# convert wide to long. duration probs are stored in long format so that
# inbound/outbound duration probs, which both have a 0 alternative, can be
# stored in a single config file. open to better suggestions here.
Expand DownExpand Up@@ -203,7 +200,6 @@ def _preprocess_scheduling_probs(
def _postprocess_scheduling_choices(
scheduling_mode, depart_alt_base, choices, choice_cols, choosers
):

"""
This method just converts the choice column indexes returned by the
logit.make_choices() method into actual departure time values that are
Expand All@@ -222,7 +218,6 @@ def _postprocess_scheduling_choices(
# get applied to trip-specific departure and arrival times, so depart_alt_base
# is a column/series rather than a scalar.
if scheduling_mode == "stop_duration":

# for outbound trips, offsets get added to the departure time constraint
if choosers.outbound.all():
depart_alt_base = choosers["earliest"]
Expand Down
8 changes: 2 additions & 6 deletions activitysim/abm/models/util/test/test_input_checker.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,11 +7,11 @@

import pandas as pd
import pandas.testing as pdt
import pandera as pa
import pytest
import yaml
import pandera as pa

from activitysim.abm.models.input_checker import validate_with_pandera, TABLE_STORE
from activitysim.abm.models.input_checker import TABLE_STORE, validate_with_pandera


@pytest.fixture(scope="class")
Expand DownExpand Up@@ -56,7 +56,6 @@ def households():


def test_passing_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -83,7 +82,6 @@ def dummy_example(cls, households: pd.DataFrame):


def test_error_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -107,7 +105,6 @@ class Household(pa.DataFrameModel):


def test_warning_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -132,7 +129,6 @@ class Household(pa.DataFrameModel):
def test_custom_check_failure_dataframe(
households, v_errors, v_warnings, validation_settings
):

TABLE_STORE["households"] = households

class input_checker:
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/util/trip.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,6 @@


def failed_trip_cohorts(trips, failed):

# outbound trips in a tour with a failed outbound trip
bad_outbound_trips = trips.outbound & (
trips.tour_id.isin(trips.tour_id[failed & trips.outbound])
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/tables/households.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -127,7 +127,6 @@ def households_merged(
land_use: pd.DataFrame,
accessibility: pd.DataFrame,
) -> pd.DataFrame:

households = simple_table_join(
households,
land_use,
Expand Down
2 changes: 0 additions & 2 deletions activitysim/abm/tables/table_dict.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,13 +18,11 @@

@workflow.cached_object
def rng_channels(state: workflow.State):

return cid.RANDOM_CHANNELS


@workflow.cached_object
def traceable_tables(state: workflow.State):

# names of all traceable tables ordered by dependency on household_id
# e.g. 'persons' has to be registered AFTER 'households'

Expand Down
4 changes: 2 additions & 2 deletions activitysim/abm/test/run_multi_zone_mp.py
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

# ActivitySim
# See full license in LICENSE.txt.
import os
Expand All@@ -13,7 +15,6 @@


def test_mp_run():

configs_dir = [example_path("configs_3_zone"), example_path("configs")]
data_dir = example_path("data_3")

Expand All@@ -34,5 +35,4 @@ def test_mp_run():


if __name__ == "__main__":

test_mp_run()
2 changes: 0 additions & 2 deletions activitysim/abm/test/test_misc/setup_utils.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,6 @@ def example_path(dirname):


def setup_dirs(ancillary_configs_dir=None, data_dir=None):

# ancillary_configs_dir is used by run_mp to test multiprocess

# test_pipeline_configs_dir = os.path.join(os.path.dirname(__file__), "configs")
Expand DownExpand Up@@ -69,7 +68,6 @@ def setup_dirs(ancillary_configs_dir=None, data_dir=None):


def close_handlers():

loggers = logging.Logger.manager.loggerDict
for name in loggers:
logger = logging.getLogger(name)
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/core_tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@ on:
pull_request:
branches:
- '*'

workflow_dispatch:

env:
Expand DownExpand Up@@ -455,7 +455,7 @@ jobs:

develop-docbuild:
needs: foundation
if: github.ref_name == 'main'
if: github.ref_name == 'main' || github.ref_name == 'docs-fix'
name: develop-docbuild
runs-on: ubuntu-latest
permissions:
Expand Down
3 changes: 0 additions & 3 deletions activitysim/abm/misc.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,7 +18,6 @@

@workflow.cached_object
def households_sample_size(state: workflow.State, override_hh_ids) -> int:

if override_hh_ids is None:
return state.settings.households_sample_size
else:
Expand All@@ -27,7 +26,6 @@ def households_sample_size(state: workflow.State, override_hh_ids) -> int:

@workflow.cached_object
def override_hh_ids(state: workflow.State) -> np.ndarray | None:

hh_ids_filename = state.settings.hh_ids
if hh_ids_filename is None:
return None
Expand DownExpand Up@@ -65,7 +63,6 @@ def override_hh_ids(state: workflow.State) -> np.ndarray | None:

@workflow.cached_object
def trace_od(state: workflow.State) -> tuple[int, int] | None:

od = state.settings.trace_od

if od and not (
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/auto_ownership.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -72,7 +72,6 @@ def auto_ownership_simulate(
# - preprocessor
preprocessor_settings = model_settings.preprocessor
if preprocessor_settings:

locals_d = {}
if constants is not None:
locals_d.update(constants)
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/initialize.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,7 +148,6 @@ def initialize_households(
model_settings_file_name: str = "initialize_households.yaml",
trace_label: str = "initialize_households",
) -> None:

with chunk.chunk_log(state, trace_label, base=True) as chunk_sizer:
chunk_sizer.log_rss(f"{trace_label}.inside-yield")

Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/input_checker.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -209,7 +209,6 @@ class HouseholdValidator(pydantic.BaseModel) list_of_households...


def report_errors(state, input_checker_settings, v_warnings, v_errors):

# logging overall statistics first before printing details
for table_settings in input_checker_settings["table_list"]:
table_name = table_settings["name"]
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/non_mandatory_tour_frequency.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -236,7 +236,6 @@ def non_mandatory_tour_frequency(
# - preprocessor
preprocessor_settings = model_settings.preprocessor
if preprocessor_settings:

locals_dict = {
"person_max_window": lambda x: person_max_window(state, x),
"person_available_periods": lambda persons, start_bin, end_bin, continuous: person_available_periods(
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/trip_purpose_and_destination.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,7 +69,6 @@ def trip_purpose_and_destination(
model_settings_file_name: str = "trip_purpose_and_destination.yaml",
trace_label: str = "trip_purpose_and_destination",
) -> None:

if model_settings is None:
model_settings = TripPurposeAndDestinationSettings.read_settings_file(
state.filesystem,
Expand Down
2 changes: 0 additions & 2 deletions activitysim/abm/models/trip_scheduling_choice.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -358,7 +358,6 @@ def trip_scheduling_choice(
model_settings_file_name: str = "trip_scheduling_choice.yaml",
trace_label: str = "trip_scheduling_choice",
) -> None:

if model_settings is None:
model_settings = TripSchedulingChoiceSettings.read_settings_file(
state.filesystem,
Expand DownExpand Up@@ -416,7 +415,6 @@ def trip_scheduling_choice(
}

if preprocessor_settings:

simulate.set_skim_wrapper_targets(tours_df, skims)

expressions.assign_columns(
Expand Down
4 changes: 0 additions & 4 deletions activitysim/abm/models/util/cdap.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -297,7 +297,6 @@ def cached_joint_spec_name(hhsize):


def get_cached_spec(state: workflow.State, hhsize):

spec_name = cached_spec_name(hhsize)

spec = state.get_injectable(spec_name, None)
Expand All@@ -319,7 +318,6 @@ def get_cached_spec(state: workflow.State, hhsize):


def get_cached_joint_spec(state: workflow.State, hhsize):

spec_name = cached_joint_spec_name(hhsize)

spec = state.get_injectable(spec_name, None)
Expand DownExpand Up@@ -625,7 +623,6 @@ def build_cdap_joint_spec(
# N_p1 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0
for pnum in range(1, hhsize + 1):
for activity in ["M", "N", "H"]:

new_row_index = len(spec)
spec.loc[new_row_index, expression_name] = add_pn(activity, pnum)

Expand All@@ -638,7 +635,6 @@ def build_cdap_joint_spec(

# for each row in the joint util table
for row in joint_tour_coefficients.itertuples():

# if there is no dependencies
if row.dependency is np.nan:
expression = row.Expression
Expand Down
4 changes: 0 additions & 4 deletions activitysim/abm/models/util/overlap.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -138,7 +138,6 @@ def p2p_time_window_overlap(state: workflow.State, p1_ids, p2_ids):


def person_pairs(persons):

p = persons[["household_id", "adult"]].reset_index()
p2p = pd.merge(p, p, left_on="household_id", right_on="household_id", how="outer")

Expand DownExpand Up@@ -166,7 +165,6 @@ def person_pairs(persons):


def hh_time_window_overlap(state: workflow.State, households, persons):

p2p = person_pairs(persons)

p2p["max_overlap"] = p2p_time_window_overlap(state, p2p.person1, p2p.person2)
Expand All@@ -189,7 +187,6 @@ def hh_time_window_overlap(state: workflow.State, households, persons):


def person_time_window_overlap(state: workflow.State, persons):

p2p = person_pairs(persons)

p2p["max_overlap"] = p2p_time_window_overlap(state, p2p.person1, p2p.person2)
Expand DownExpand Up@@ -224,7 +221,6 @@ def person_time_window_overlap(state: workflow.State, persons):


def person_max_window(state: workflow.State, persons):

timetable = state.get_injectable("timetable")

# ndarray with one row per person and one column per time period
Expand Down
5 changes: 0 additions & 5 deletions activitysim/abm/models/util/probabilistic_scheduling.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -93,7 +93,6 @@ def _report_bad_choices(
# log the indexes of the first MAX_PRINT offending rows
MAX_PRINT = 0
for idx in df.index[:MAX_PRINT].values:

row_msg = "%s : failed %s = %s (hh_id = %s)" % (
trace_label,
df.index.name,
Expand All@@ -113,7 +112,6 @@ def _preprocess_departure_probs(
depart_alt_base,
first_trip_in_leg,
):

# zero out probs outside earliest-latest window if one exists
probs_cols = [c for c in probs_spec.columns if c not in probs_join_cols]
if clip_earliest_latest:
Expand All@@ -129,7 +127,6 @@ def _preprocess_departure_probs(


def _preprocess_stop_duration_probs(choosers):

# convert wide to long. duration probs are stored in long format so that
# inbound/outbound duration probs, which both have a 0 alternative, can be
# stored in a single config file. open to better suggestions here.
Expand DownExpand Up@@ -203,7 +200,6 @@ def _preprocess_scheduling_probs(
def _postprocess_scheduling_choices(
scheduling_mode, depart_alt_base, choices, choice_cols, choosers
):

"""
This method just converts the choice column indexes returned by the
logit.make_choices() method into actual departure time values that are
Expand All@@ -222,7 +218,6 @@ def _postprocess_scheduling_choices(
# get applied to trip-specific departure and arrival times, so depart_alt_base
# is a column/series rather than a scalar.
if scheduling_mode == "stop_duration":

# for outbound trips, offsets get added to the departure time constraint
if choosers.outbound.all():
depart_alt_base = choosers["earliest"]
Expand Down
8 changes: 2 additions & 6 deletions activitysim/abm/models/util/test/test_input_checker.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,11 +7,11 @@

import pandas as pd
import pandas.testing as pdt
import pandera as pa
import pytest
import yaml
import pandera as pa

from activitysim.abm.models.input_checker import validate_with_pandera, TABLE_STORE
from activitysim.abm.models.input_checker import TABLE_STORE, validate_with_pandera


@pytest.fixture(scope="class")
Expand DownExpand Up@@ -56,7 +56,6 @@ def households():


def test_passing_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -83,7 +82,6 @@ def dummy_example(cls, households: pd.DataFrame):


def test_error_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -107,7 +105,6 @@ class Household(pa.DataFrameModel):


def test_warning_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -132,7 +129,6 @@ class Household(pa.DataFrameModel):
def test_custom_check_failure_dataframe(
households, v_errors, v_warnings, validation_settings
):

TABLE_STORE["households"] = households

class input_checker:
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/util/trip.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,6 @@


def failed_trip_cohorts(trips, failed):

# outbound trips in a tour with a failed outbound trip
bad_outbound_trips = trips.outbound & (
trips.tour_id.isin(trips.tour_id[failed & trips.outbound])
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/tables/households.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -127,7 +127,6 @@ def households_merged(
land_use: pd.DataFrame,
accessibility: pd.DataFrame,
) -> pd.DataFrame:

households = simple_table_join(
households,
land_use,
Expand Down
2 changes: 0 additions & 2 deletions activitysim/abm/tables/table_dict.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,13 +18,11 @@

@workflow.cached_object
def rng_channels(state: workflow.State):

return cid.RANDOM_CHANNELS


@workflow.cached_object
def traceable_tables(state: workflow.State):

# names of all traceable tables ordered by dependency on household_id
# e.g. 'persons' has to be registered AFTER 'households'

Expand Down
4 changes: 2 additions & 2 deletions activitysim/abm/test/run_multi_zone_mp.py
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

# ActivitySim
# See full license in LICENSE.txt.
import os
Expand All@@ -13,7 +15,6 @@


def test_mp_run():

configs_dir = [example_path("configs_3_zone"), example_path("configs")]
data_dir = example_path("data_3")

Expand All@@ -34,5 +35,4 @@ def test_mp_run():


if __name__ == "__main__":

test_mp_run()
2 changes: 0 additions & 2 deletions activitysim/abm/test/test_misc/setup_utils.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,6 @@ def example_path(dirname):


def setup_dirs(ancillary_configs_dir=None, data_dir=None):

# ancillary_configs_dir is used by run_mp to test multiprocess

# test_pipeline_configs_dir = os.path.join(os.path.dirname(__file__), "configs")
Expand DownExpand Up@@ -69,7 +68,6 @@ def setup_dirs(ancillary_configs_dir=None, data_dir=None):


def close_handlers():

loggers = logging.Logger.manager.loggerDict
for name in loggers:
logger = logging.getLogger(name)
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/core_tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@ on:
pull_request:
branches:
- '*'

workflow_dispatch:

env:
Expand DownExpand Up@@ -455,7 +455,7 @@ jobs:

develop-docbuild:
needs: foundation
if: github.ref_name == 'main'
if: github.ref_name == 'main' || github.ref_name == 'docs-fix'
name: develop-docbuild
runs-on: ubuntu-latest
permissions:
Expand Down
3 changes: 0 additions & 3 deletions activitysim/abm/misc.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,7 +18,6 @@

@workflow.cached_object
def households_sample_size(state: workflow.State, override_hh_ids) -> int:

if override_hh_ids is None:
return state.settings.households_sample_size
else:
Expand All@@ -27,7 +26,6 @@ def households_sample_size(state: workflow.State, override_hh_ids) -> int:

@workflow.cached_object
def override_hh_ids(state: workflow.State) -> np.ndarray | None:

hh_ids_filename = state.settings.hh_ids
if hh_ids_filename is None:
return None
Expand DownExpand Up@@ -65,7 +63,6 @@ def override_hh_ids(state: workflow.State) -> np.ndarray | None:

@workflow.cached_object
def trace_od(state: workflow.State) -> tuple[int, int] | None:

od = state.settings.trace_od

if od and not (
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/auto_ownership.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -72,7 +72,6 @@ def auto_ownership_simulate(
# - preprocessor
preprocessor_settings = model_settings.preprocessor
if preprocessor_settings:

locals_d = {}
if constants is not None:
locals_d.update(constants)
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/initialize.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,7 +148,6 @@ def initialize_households(
model_settings_file_name: str = "initialize_households.yaml",
trace_label: str = "initialize_households",
) -> None:

with chunk.chunk_log(state, trace_label, base=True) as chunk_sizer:
chunk_sizer.log_rss(f"{trace_label}.inside-yield")

Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/input_checker.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -209,7 +209,6 @@ class HouseholdValidator(pydantic.BaseModel) list_of_households...


def report_errors(state, input_checker_settings, v_warnings, v_errors):

# logging overall statistics first before printing details
for table_settings in input_checker_settings["table_list"]:
table_name = table_settings["name"]
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/non_mandatory_tour_frequency.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -236,7 +236,6 @@ def non_mandatory_tour_frequency(
# - preprocessor
preprocessor_settings = model_settings.preprocessor
if preprocessor_settings:

locals_dict = {
"person_max_window": lambda x: person_max_window(state, x),
"person_available_periods": lambda persons, start_bin, end_bin, continuous: person_available_periods(
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/trip_purpose_and_destination.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,7 +69,6 @@ def trip_purpose_and_destination(
model_settings_file_name: str = "trip_purpose_and_destination.yaml",
trace_label: str = "trip_purpose_and_destination",
) -> None:

if model_settings is None:
model_settings = TripPurposeAndDestinationSettings.read_settings_file(
state.filesystem,
Expand Down
2 changes: 0 additions & 2 deletions activitysim/abm/models/trip_scheduling_choice.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -358,7 +358,6 @@ def trip_scheduling_choice(
model_settings_file_name: str = "trip_scheduling_choice.yaml",
trace_label: str = "trip_scheduling_choice",
) -> None:

if model_settings is None:
model_settings = TripSchedulingChoiceSettings.read_settings_file(
state.filesystem,
Expand DownExpand Up@@ -416,7 +415,6 @@ def trip_scheduling_choice(
}

if preprocessor_settings:

simulate.set_skim_wrapper_targets(tours_df, skims)

expressions.assign_columns(
Expand Down
4 changes: 0 additions & 4 deletions activitysim/abm/models/util/cdap.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -297,7 +297,6 @@ def cached_joint_spec_name(hhsize):


def get_cached_spec(state: workflow.State, hhsize):

spec_name = cached_spec_name(hhsize)

spec = state.get_injectable(spec_name, None)
Expand All@@ -319,7 +318,6 @@ def get_cached_spec(state: workflow.State, hhsize):


def get_cached_joint_spec(state: workflow.State, hhsize):

spec_name = cached_joint_spec_name(hhsize)

spec = state.get_injectable(spec_name, None)
Expand DownExpand Up@@ -625,7 +623,6 @@ def build_cdap_joint_spec(
# N_p1 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0
for pnum in range(1, hhsize + 1):
for activity in ["M", "N", "H"]:

new_row_index = len(spec)
spec.loc[new_row_index, expression_name] = add_pn(activity, pnum)

Expand All@@ -638,7 +635,6 @@ def build_cdap_joint_spec(

# for each row in the joint util table
for row in joint_tour_coefficients.itertuples():

# if there is no dependencies
if row.dependency is np.nan:
expression = row.Expression
Expand Down
4 changes: 0 additions & 4 deletions activitysim/abm/models/util/overlap.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -138,7 +138,6 @@ def p2p_time_window_overlap(state: workflow.State, p1_ids, p2_ids):


def person_pairs(persons):

p = persons[["household_id", "adult"]].reset_index()
p2p = pd.merge(p, p, left_on="household_id", right_on="household_id", how="outer")

Expand DownExpand Up@@ -166,7 +165,6 @@ def person_pairs(persons):


def hh_time_window_overlap(state: workflow.State, households, persons):

p2p = person_pairs(persons)

p2p["max_overlap"] = p2p_time_window_overlap(state, p2p.person1, p2p.person2)
Expand All@@ -189,7 +187,6 @@ def hh_time_window_overlap(state: workflow.State, households, persons):


def person_time_window_overlap(state: workflow.State, persons):

p2p = person_pairs(persons)

p2p["max_overlap"] = p2p_time_window_overlap(state, p2p.person1, p2p.person2)
Expand DownExpand Up@@ -224,7 +221,6 @@ def person_time_window_overlap(state: workflow.State, persons):


def person_max_window(state: workflow.State, persons):

timetable = state.get_injectable("timetable")

# ndarray with one row per person and one column per time period
Expand Down
5 changes: 0 additions & 5 deletions activitysim/abm/models/util/probabilistic_scheduling.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -93,7 +93,6 @@ def _report_bad_choices(
# log the indexes of the first MAX_PRINT offending rows
MAX_PRINT = 0
for idx in df.index[:MAX_PRINT].values:

row_msg = "%s : failed %s = %s (hh_id = %s)" % (
trace_label,
df.index.name,
Expand All@@ -113,7 +112,6 @@ def _preprocess_departure_probs(
depart_alt_base,
first_trip_in_leg,
):

# zero out probs outside earliest-latest window if one exists
probs_cols = [c for c in probs_spec.columns if c not in probs_join_cols]
if clip_earliest_latest:
Expand All@@ -129,7 +127,6 @@ def _preprocess_departure_probs(


def _preprocess_stop_duration_probs(choosers):

# convert wide to long. duration probs are stored in long format so that
# inbound/outbound duration probs, which both have a 0 alternative, can be
# stored in a single config file. open to better suggestions here.
Expand DownExpand Up@@ -203,7 +200,6 @@ def _preprocess_scheduling_probs(
def _postprocess_scheduling_choices(
scheduling_mode, depart_alt_base, choices, choice_cols, choosers
):

"""
This method just converts the choice column indexes returned by the
logit.make_choices() method into actual departure time values that are
Expand All@@ -222,7 +218,6 @@ def _postprocess_scheduling_choices(
# get applied to trip-specific departure and arrival times, so depart_alt_base
# is a column/series rather than a scalar.
if scheduling_mode == "stop_duration":

# for outbound trips, offsets get added to the departure time constraint
if choosers.outbound.all():
depart_alt_base = choosers["earliest"]
Expand Down
8 changes: 2 additions & 6 deletions activitysim/abm/models/util/test/test_input_checker.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,11 +7,11 @@

import pandas as pd
import pandas.testing as pdt
import pandera as pa
import pytest
import yaml
import pandera as pa

from activitysim.abm.models.input_checker import validate_with_pandera, TABLE_STORE
from activitysim.abm.models.input_checker import TABLE_STORE, validate_with_pandera


@pytest.fixture(scope="class")
Expand DownExpand Up@@ -56,7 +56,6 @@ def households():


def test_passing_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -83,7 +82,6 @@ def dummy_example(cls, households: pd.DataFrame):


def test_error_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -107,7 +105,6 @@ class Household(pa.DataFrameModel):


def test_warning_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -132,7 +129,6 @@ class Household(pa.DataFrameModel):
def test_custom_check_failure_dataframe(
households, v_errors, v_warnings, validation_settings
):

TABLE_STORE["households"] = households

class input_checker:
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/util/trip.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,6 @@


def failed_trip_cohorts(trips, failed):

# outbound trips in a tour with a failed outbound trip
bad_outbound_trips = trips.outbound & (
trips.tour_id.isin(trips.tour_id[failed & trips.outbound])
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/tables/households.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -127,7 +127,6 @@ def households_merged(
land_use: pd.DataFrame,
accessibility: pd.DataFrame,
) -> pd.DataFrame:

households = simple_table_join(
households,
land_use,
Expand Down
2 changes: 0 additions & 2 deletions activitysim/abm/tables/table_dict.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,13 +18,11 @@

@workflow.cached_object
def rng_channels(state: workflow.State):

return cid.RANDOM_CHANNELS


@workflow.cached_object
def traceable_tables(state: workflow.State):

# names of all traceable tables ordered by dependency on household_id
# e.g. 'persons' has to be registered AFTER 'households'

Expand Down
4 changes: 2 additions & 2 deletions activitysim/abm/test/run_multi_zone_mp.py
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

# ActivitySim
# See full license in LICENSE.txt.
import os
Expand All@@ -13,7 +15,6 @@


def test_mp_run():

configs_dir = [example_path("configs_3_zone"), example_path("configs")]
data_dir = example_path("data_3")

Expand All@@ -34,5 +35,4 @@ def test_mp_run():


if __name__ == "__main__":

test_mp_run()
2 changes: 0 additions & 2 deletions activitysim/abm/test/test_misc/setup_utils.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,6 @@ def example_path(dirname):


def setup_dirs(ancillary_configs_dir=None, data_dir=None):

# ancillary_configs_dir is used by run_mp to test multiprocess

# test_pipeline_configs_dir = os.path.join(os.path.dirname(__file__), "configs")
Expand DownExpand Up@@ -69,7 +68,6 @@ def setup_dirs(ancillary_configs_dir=None, data_dir=None):


def close_handlers():

loggers = logging.Logger.manager.loggerDict
for name in loggers:
logger = logging.getLogger(name)
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/core_tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@ on:
pull_request:
branches:
- '*'

workflow_dispatch:

env:
Expand DownExpand Up@@ -455,7 +455,7 @@ jobs:

develop-docbuild:
needs: foundation
if: github.ref_name == 'main'
if: github.ref_name == 'main' || github.ref_name == 'docs-fix'
name: develop-docbuild
runs-on: ubuntu-latest
permissions:
Expand Down
3 changes: 0 additions & 3 deletions activitysim/abm/misc.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,7 +18,6 @@

@workflow.cached_object
def households_sample_size(state: workflow.State, override_hh_ids) -> int:

if override_hh_ids is None:
return state.settings.households_sample_size
else:
Expand All@@ -27,7 +26,6 @@ def households_sample_size(state: workflow.State, override_hh_ids) -> int:

@workflow.cached_object
def override_hh_ids(state: workflow.State) -> np.ndarray | None:

hh_ids_filename = state.settings.hh_ids
if hh_ids_filename is None:
return None
Expand DownExpand Up@@ -65,7 +63,6 @@ def override_hh_ids(state: workflow.State) -> np.ndarray | None:

@workflow.cached_object
def trace_od(state: workflow.State) -> tuple[int, int] | None:

od = state.settings.trace_od

if od and not (
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/auto_ownership.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -72,7 +72,6 @@ def auto_ownership_simulate(
# - preprocessor
preprocessor_settings = model_settings.preprocessor
if preprocessor_settings:

locals_d = {}
if constants is not None:
locals_d.update(constants)
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/initialize.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,7 +148,6 @@ def initialize_households(
model_settings_file_name: str = "initialize_households.yaml",
trace_label: str = "initialize_households",
) -> None:

with chunk.chunk_log(state, trace_label, base=True) as chunk_sizer:
chunk_sizer.log_rss(f"{trace_label}.inside-yield")

Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/input_checker.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -209,7 +209,6 @@ class HouseholdValidator(pydantic.BaseModel) list_of_households...


def report_errors(state, input_checker_settings, v_warnings, v_errors):

# logging overall statistics first before printing details
for table_settings in input_checker_settings["table_list"]:
table_name = table_settings["name"]
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/non_mandatory_tour_frequency.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -236,7 +236,6 @@ def non_mandatory_tour_frequency(
# - preprocessor
preprocessor_settings = model_settings.preprocessor
if preprocessor_settings:

locals_dict = {
"person_max_window": lambda x: person_max_window(state, x),
"person_available_periods": lambda persons, start_bin, end_bin, continuous: person_available_periods(
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/trip_purpose_and_destination.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,7 +69,6 @@ def trip_purpose_and_destination(
model_settings_file_name: str = "trip_purpose_and_destination.yaml",
trace_label: str = "trip_purpose_and_destination",
) -> None:

if model_settings is None:
model_settings = TripPurposeAndDestinationSettings.read_settings_file(
state.filesystem,
Expand Down
2 changes: 0 additions & 2 deletions activitysim/abm/models/trip_scheduling_choice.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -358,7 +358,6 @@ def trip_scheduling_choice(
model_settings_file_name: str = "trip_scheduling_choice.yaml",
trace_label: str = "trip_scheduling_choice",
) -> None:

if model_settings is None:
model_settings = TripSchedulingChoiceSettings.read_settings_file(
state.filesystem,
Expand DownExpand Up@@ -416,7 +415,6 @@ def trip_scheduling_choice(
}

if preprocessor_settings:

simulate.set_skim_wrapper_targets(tours_df, skims)

expressions.assign_columns(
Expand Down
4 changes: 0 additions & 4 deletions activitysim/abm/models/util/cdap.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -297,7 +297,6 @@ def cached_joint_spec_name(hhsize):


def get_cached_spec(state: workflow.State, hhsize):

spec_name = cached_spec_name(hhsize)

spec = state.get_injectable(spec_name, None)
Expand All@@ -319,7 +318,6 @@ def get_cached_spec(state: workflow.State, hhsize):


def get_cached_joint_spec(state: workflow.State, hhsize):

spec_name = cached_joint_spec_name(hhsize)

spec = state.get_injectable(spec_name, None)
Expand DownExpand Up@@ -625,7 +623,6 @@ def build_cdap_joint_spec(
# N_p1 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0
for pnum in range(1, hhsize + 1):
for activity in ["M", "N", "H"]:

new_row_index = len(spec)
spec.loc[new_row_index, expression_name] = add_pn(activity, pnum)

Expand All@@ -638,7 +635,6 @@ def build_cdap_joint_spec(

# for each row in the joint util table
for row in joint_tour_coefficients.itertuples():

# if there is no dependencies
if row.dependency is np.nan:
expression = row.Expression
Expand Down
4 changes: 0 additions & 4 deletions activitysim/abm/models/util/overlap.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -138,7 +138,6 @@ def p2p_time_window_overlap(state: workflow.State, p1_ids, p2_ids):


def person_pairs(persons):

p = persons[["household_id", "adult"]].reset_index()
p2p = pd.merge(p, p, left_on="household_id", right_on="household_id", how="outer")

Expand DownExpand Up@@ -166,7 +165,6 @@ def person_pairs(persons):


def hh_time_window_overlap(state: workflow.State, households, persons):

p2p = person_pairs(persons)

p2p["max_overlap"] = p2p_time_window_overlap(state, p2p.person1, p2p.person2)
Expand All@@ -189,7 +187,6 @@ def hh_time_window_overlap(state: workflow.State, households, persons):


def person_time_window_overlap(state: workflow.State, persons):

p2p = person_pairs(persons)

p2p["max_overlap"] = p2p_time_window_overlap(state, p2p.person1, p2p.person2)
Expand DownExpand Up@@ -224,7 +221,6 @@ def person_time_window_overlap(state: workflow.State, persons):


def person_max_window(state: workflow.State, persons):

timetable = state.get_injectable("timetable")

# ndarray with one row per person and one column per time period
Expand Down
5 changes: 0 additions & 5 deletions activitysim/abm/models/util/probabilistic_scheduling.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -93,7 +93,6 @@ def _report_bad_choices(
# log the indexes of the first MAX_PRINT offending rows
MAX_PRINT = 0
for idx in df.index[:MAX_PRINT].values:

row_msg = "%s : failed %s = %s (hh_id = %s)" % (
trace_label,
df.index.name,
Expand All@@ -113,7 +112,6 @@ def _preprocess_departure_probs(
depart_alt_base,
first_trip_in_leg,
):

# zero out probs outside earliest-latest window if one exists
probs_cols = [c for c in probs_spec.columns if c not in probs_join_cols]
if clip_earliest_latest:
Expand All@@ -129,7 +127,6 @@ def _preprocess_departure_probs(


def _preprocess_stop_duration_probs(choosers):

# convert wide to long. duration probs are stored in long format so that
# inbound/outbound duration probs, which both have a 0 alternative, can be
# stored in a single config file. open to better suggestions here.
Expand DownExpand Up@@ -203,7 +200,6 @@ def _preprocess_scheduling_probs(
def _postprocess_scheduling_choices(
scheduling_mode, depart_alt_base, choices, choice_cols, choosers
):

"""
This method just converts the choice column indexes returned by the
logit.make_choices() method into actual departure time values that are
Expand All@@ -222,7 +218,6 @@ def _postprocess_scheduling_choices(
# get applied to trip-specific departure and arrival times, so depart_alt_base
# is a column/series rather than a scalar.
if scheduling_mode == "stop_duration":

# for outbound trips, offsets get added to the departure time constraint
if choosers.outbound.all():
depart_alt_base = choosers["earliest"]
Expand Down
8 changes: 2 additions & 6 deletions activitysim/abm/models/util/test/test_input_checker.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,11 +7,11 @@

import pandas as pd
import pandas.testing as pdt
import pandera as pa
import pytest
import yaml
import pandera as pa

from activitysim.abm.models.input_checker import validate_with_pandera, TABLE_STORE
from activitysim.abm.models.input_checker import TABLE_STORE, validate_with_pandera


@pytest.fixture(scope="class")
Expand DownExpand Up@@ -56,7 +56,6 @@ def households():


def test_passing_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -83,7 +82,6 @@ def dummy_example(cls, households: pd.DataFrame):


def test_error_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -107,7 +105,6 @@ class Household(pa.DataFrameModel):


def test_warning_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -132,7 +129,6 @@ class Household(pa.DataFrameModel):
def test_custom_check_failure_dataframe(
households, v_errors, v_warnings, validation_settings
):

TABLE_STORE["households"] = households

class input_checker:
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/util/trip.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,6 @@


def failed_trip_cohorts(trips, failed):

# outbound trips in a tour with a failed outbound trip
bad_outbound_trips = trips.outbound & (
trips.tour_id.isin(trips.tour_id[failed & trips.outbound])
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/tables/households.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -127,7 +127,6 @@ def households_merged(
land_use: pd.DataFrame,
accessibility: pd.DataFrame,
) -> pd.DataFrame:

households = simple_table_join(
households,
land_use,
Expand Down
2 changes: 0 additions & 2 deletions activitysim/abm/tables/table_dict.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,13 +18,11 @@

@workflow.cached_object
def rng_channels(state: workflow.State):

return cid.RANDOM_CHANNELS


@workflow.cached_object
def traceable_tables(state: workflow.State):

# names of all traceable tables ordered by dependency on household_id
# e.g. 'persons' has to be registered AFTER 'households'

Expand Down
4 changes: 2 additions & 2 deletions activitysim/abm/test/run_multi_zone_mp.py
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

# ActivitySim
# See full license in LICENSE.txt.
import os
Expand All@@ -13,7 +15,6 @@


def test_mp_run():

configs_dir = [example_path("configs_3_zone"), example_path("configs")]
data_dir = example_path("data_3")

Expand All@@ -34,5 +35,4 @@ def test_mp_run():


if __name__ == "__main__":

test_mp_run()
2 changes: 0 additions & 2 deletions activitysim/abm/test/test_misc/setup_utils.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,6 @@ def example_path(dirname):


def setup_dirs(ancillary_configs_dir=None, data_dir=None):

# ancillary_configs_dir is used by run_mp to test multiprocess

# test_pipeline_configs_dir = os.path.join(os.path.dirname(__file__), "configs")
Expand DownExpand Up@@ -69,7 +68,6 @@ def setup_dirs(ancillary_configs_dir=None, data_dir=None):


def close_handlers():

loggers = logging.Logger.manager.loggerDict
for name in loggers:
logger = logging.getLogger(name)
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/core_tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@ on:
pull_request:
branches:
- '*'

workflow_dispatch:

env:
Expand DownExpand Up@@ -455,7 +455,7 @@ jobs:

develop-docbuild:
needs: foundation
if: github.ref_name == 'main'
if: github.ref_name == 'main' || github.ref_name == 'docs-fix'
name: develop-docbuild
runs-on: ubuntu-latest
permissions:
Expand Down
3 changes: 0 additions & 3 deletions activitysim/abm/misc.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,7 +18,6 @@

@workflow.cached_object
def households_sample_size(state: workflow.State, override_hh_ids) -> int:

if override_hh_ids is None:
return state.settings.households_sample_size
else:
Expand All@@ -27,7 +26,6 @@ def households_sample_size(state: workflow.State, override_hh_ids) -> int:

@workflow.cached_object
def override_hh_ids(state: workflow.State) -> np.ndarray | None:

hh_ids_filename = state.settings.hh_ids
if hh_ids_filename is None:
return None
Expand DownExpand Up@@ -65,7 +63,6 @@ def override_hh_ids(state: workflow.State) -> np.ndarray | None:

@workflow.cached_object
def trace_od(state: workflow.State) -> tuple[int, int] | None:

od = state.settings.trace_od

if od and not (
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/auto_ownership.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -72,7 +72,6 @@ def auto_ownership_simulate(
# - preprocessor
preprocessor_settings = model_settings.preprocessor
if preprocessor_settings:

locals_d = {}
if constants is not None:
locals_d.update(constants)
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/initialize.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -148,7 +148,6 @@ def initialize_households(
model_settings_file_name: str = "initialize_households.yaml",
trace_label: str = "initialize_households",
) -> None:

with chunk.chunk_log(state, trace_label, base=True) as chunk_sizer:
chunk_sizer.log_rss(f"{trace_label}.inside-yield")

Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/input_checker.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -209,7 +209,6 @@ class HouseholdValidator(pydantic.BaseModel) list_of_households...


def report_errors(state, input_checker_settings, v_warnings, v_errors):

# logging overall statistics first before printing details
for table_settings in input_checker_settings["table_list"]:
table_name = table_settings["name"]
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/non_mandatory_tour_frequency.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -236,7 +236,6 @@ def non_mandatory_tour_frequency(
# - preprocessor
preprocessor_settings = model_settings.preprocessor
if preprocessor_settings:

locals_dict = {
"person_max_window": lambda x: person_max_window(state, x),
"person_available_periods": lambda persons, start_bin, end_bin, continuous: person_available_periods(
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/trip_purpose_and_destination.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,7 +69,6 @@ def trip_purpose_and_destination(
model_settings_file_name: str = "trip_purpose_and_destination.yaml",
trace_label: str = "trip_purpose_and_destination",
) -> None:

if model_settings is None:
model_settings = TripPurposeAndDestinationSettings.read_settings_file(
state.filesystem,
Expand Down
2 changes: 0 additions & 2 deletions activitysim/abm/models/trip_scheduling_choice.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -358,7 +358,6 @@ def trip_scheduling_choice(
model_settings_file_name: str = "trip_scheduling_choice.yaml",
trace_label: str = "trip_scheduling_choice",
) -> None:

if model_settings is None:
model_settings = TripSchedulingChoiceSettings.read_settings_file(
state.filesystem,
Expand DownExpand Up@@ -416,7 +415,6 @@ def trip_scheduling_choice(
}

if preprocessor_settings:

simulate.set_skim_wrapper_targets(tours_df, skims)

expressions.assign_columns(
Expand Down
4 changes: 0 additions & 4 deletions activitysim/abm/models/util/cdap.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -297,7 +297,6 @@ def cached_joint_spec_name(hhsize):


def get_cached_spec(state: workflow.State, hhsize):

spec_name = cached_spec_name(hhsize)

spec = state.get_injectable(spec_name, None)
Expand All@@ -319,7 +318,6 @@ def get_cached_spec(state: workflow.State, hhsize):


def get_cached_joint_spec(state: workflow.State, hhsize):

spec_name = cached_joint_spec_name(hhsize)

spec = state.get_injectable(spec_name, None)
Expand DownExpand Up@@ -625,7 +623,6 @@ def build_cdap_joint_spec(
# N_p1 0.0 0.0 0.0 1.0 1.0 1.0 0.0 0.0 0.0
for pnum in range(1, hhsize + 1):
for activity in ["M", "N", "H"]:

new_row_index = len(spec)
spec.loc[new_row_index, expression_name] = add_pn(activity, pnum)

Expand All@@ -638,7 +635,6 @@ def build_cdap_joint_spec(

# for each row in the joint util table
for row in joint_tour_coefficients.itertuples():

# if there is no dependencies
if row.dependency is np.nan:
expression = row.Expression
Expand Down
4 changes: 0 additions & 4 deletions activitysim/abm/models/util/overlap.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -138,7 +138,6 @@ def p2p_time_window_overlap(state: workflow.State, p1_ids, p2_ids):


def person_pairs(persons):

p = persons[["household_id", "adult"]].reset_index()
p2p = pd.merge(p, p, left_on="household_id", right_on="household_id", how="outer")

Expand DownExpand Up@@ -166,7 +165,6 @@ def person_pairs(persons):


def hh_time_window_overlap(state: workflow.State, households, persons):

p2p = person_pairs(persons)

p2p["max_overlap"] = p2p_time_window_overlap(state, p2p.person1, p2p.person2)
Expand All@@ -189,7 +187,6 @@ def hh_time_window_overlap(state: workflow.State, households, persons):


def person_time_window_overlap(state: workflow.State, persons):

p2p = person_pairs(persons)

p2p["max_overlap"] = p2p_time_window_overlap(state, p2p.person1, p2p.person2)
Expand DownExpand Up@@ -224,7 +221,6 @@ def person_time_window_overlap(state: workflow.State, persons):


def person_max_window(state: workflow.State, persons):

timetable = state.get_injectable("timetable")

# ndarray with one row per person and one column per time period
Expand Down
5 changes: 0 additions & 5 deletions activitysim/abm/models/util/probabilistic_scheduling.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -93,7 +93,6 @@ def _report_bad_choices(
# log the indexes of the first MAX_PRINT offending rows
MAX_PRINT = 0
for idx in df.index[:MAX_PRINT].values:

row_msg = "%s : failed %s = %s (hh_id = %s)" % (
trace_label,
df.index.name,
Expand All@@ -113,7 +112,6 @@ def _preprocess_departure_probs(
depart_alt_base,
first_trip_in_leg,
):

# zero out probs outside earliest-latest window if one exists
probs_cols = [c for c in probs_spec.columns if c not in probs_join_cols]
if clip_earliest_latest:
Expand All@@ -129,7 +127,6 @@ def _preprocess_departure_probs(


def _preprocess_stop_duration_probs(choosers):

# convert wide to long. duration probs are stored in long format so that
# inbound/outbound duration probs, which both have a 0 alternative, can be
# stored in a single config file. open to better suggestions here.
Expand DownExpand Up@@ -203,7 +200,6 @@ def _preprocess_scheduling_probs(
def _postprocess_scheduling_choices(
scheduling_mode, depart_alt_base, choices, choice_cols, choosers
):

"""
This method just converts the choice column indexes returned by the
logit.make_choices() method into actual departure time values that are
Expand All@@ -222,7 +218,6 @@ def _postprocess_scheduling_choices(
# get applied to trip-specific departure and arrival times, so depart_alt_base
# is a column/series rather than a scalar.
if scheduling_mode == "stop_duration":

# for outbound trips, offsets get added to the departure time constraint
if choosers.outbound.all():
depart_alt_base = choosers["earliest"]
Expand Down
8 changes: 2 additions & 6 deletions activitysim/abm/models/util/test/test_input_checker.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,11 +7,11 @@

import pandas as pd
import pandas.testing as pdt
import pandera as pa
import pytest
import yaml
import pandera as pa

from activitysim.abm.models.input_checker import validate_with_pandera, TABLE_STORE
from activitysim.abm.models.input_checker import TABLE_STORE, validate_with_pandera


@pytest.fixture(scope="class")
Expand DownExpand Up@@ -56,7 +56,6 @@ def households():


def test_passing_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -83,7 +82,6 @@ def dummy_example(cls, households: pd.DataFrame):


def test_error_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -107,7 +105,6 @@ class Household(pa.DataFrameModel):


def test_warning_dataframe(households, v_errors, v_warnings, validation_settings):

TABLE_STORE["households"] = households

class input_checker:
Expand All@@ -132,7 +129,6 @@ class Household(pa.DataFrameModel):
def test_custom_check_failure_dataframe(
households, v_errors, v_warnings, validation_settings
):

TABLE_STORE["households"] = households

class input_checker:
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/models/util/trip.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,6 @@


def failed_trip_cohorts(trips, failed):

# outbound trips in a tour with a failed outbound trip
bad_outbound_trips = trips.outbound & (
trips.tour_id.isin(trips.tour_id[failed & trips.outbound])
Expand Down
1 change: 0 additions & 1 deletion activitysim/abm/tables/households.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -127,7 +127,6 @@ def households_merged(
land_use: pd.DataFrame,
accessibility: pd.DataFrame,
) -> pd.DataFrame:

households = simple_table_join(
households,
land_use,
Expand Down
2 changes: 0 additions & 2 deletions activitysim/abm/tables/table_dict.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,13 +18,11 @@

@workflow.cached_object
def rng_channels(state: workflow.State):

return cid.RANDOM_CHANNELS


@workflow.cached_object
def traceable_tables(state: workflow.State):

# names of all traceable tables ordered by dependency on household_id
# e.g. 'persons' has to be registered AFTER 'households'

Expand Down
4 changes: 2 additions & 2 deletions activitysim/abm/test/run_multi_zone_mp.py
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

# ActivitySim
# See full license in LICENSE.txt.
import os
Expand All@@ -13,7 +15,6 @@


def test_mp_run():

configs_dir = [example_path("configs_3_zone"), example_path("configs")]
data_dir = example_path("data_3")

Expand All@@ -34,5 +35,4 @@ def test_mp_run():


if __name__ == "__main__":

test_mp_run()
2 changes: 0 additions & 2 deletions activitysim/abm/test/test_misc/setup_utils.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,6 @@ def example_path(dirname):


def setup_dirs(ancillary_configs_dir=None, data_dir=None):

# ancillary_configs_dir is used by run_mp to test multiprocess

# test_pipeline_configs_dir = os.path.join(os.path.dirname(__file__), "configs")
Expand DownExpand Up@@ -69,7 +68,6 @@ def setup_dirs(ancillary_configs_dir=None, data_dir=None):


def close_handlers():

loggers = logging.Logger.manager.loggerDict
for name in loggers:
logger = logging.getLogger(name)
Expand Down
Loading