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 activitysim/abm/test/test_misc/setup_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# See full license in LICENSE.txt.
from __future__ import annotations

import importlib.resources
import logging
import os

Expand All @@ -10,7 +11,6 @@
import openmatrix as omx
import pandas as pd
import pandas.testing as pdt
import pkg_resources
import pytest
import yaml

Expand All @@ -32,7 +32,7 @@

def example_path(dirname):
resource = os.path.join("examples", "prototype_mtc", dirname)
return pkg_resources.resource_filename("activitysim", resource)
return str(importlib.resources.files("activitysim").joinpath(resource))


def setup_dirs(ancillary_configs_dir=None, data_dir=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# See full license in LICENSE.txt.
from __future__ import annotations

import importlib.resources
import logging
import os

Expand All @@ -10,7 +11,6 @@
import openmatrix as omx
import pandas as pd
import pandas.testing as pdt
import pkg_resources
import pytest
import yaml

Expand All @@ -34,7 +34,7 @@

def example_path(dirname):
resource = os.path.join("examples", "prototype_mtc", dirname)
return pkg_resources.resource_filename("activitysim", resource)
return str(importlib.resources.files("activitysim").joinpath(resource))


def close_handlers():
Expand Down
4 changes: 2 additions & 2 deletions activitysim/abm/test/test_pipeline/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# See full license in LICENSE.txt.
from __future__ import annotations

import importlib.resources
import logging
import os

import numpy as np
import openmatrix as omx
import pandas as pd
import pandas.testing as pdt
import pkg_resources
import pytest

from activitysim.core import random, tracing, workflow
Expand All @@ -34,7 +34,7 @@

def example_path(dirname):
resource = os.path.join("examples", "prototype_mtc", dirname)
return pkg_resources.resource_filename("activitysim", resource)
return str(importlib.resources.files("activitysim").joinpath(resource))


def setup_dirs(ancillary_configs_dir=None, data_dir=None):
Expand Down
1 change: 0 additions & 1 deletion activitysim/cli/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import zipfile
from pathlib import Path

import pkg_resources
import requests
import yaml

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@

# ActivitySim
# See full license in LICENSE.txt.
import importlib.resources
import os
import subprocess
import sys
from pathlib import Path

import pandas as pd
import pkg_resources
import pytest

from activitysim.core import test, workflow


def example_path(dirname):
resource = os.path.join("examples", "placeholder_multiple_zone", dirname)
return pkg_resources.resource_filename("activitysim", resource)
return str(importlib.resources.files("activitysim").joinpath(resource))


def mtc_example_path(dirname):
resource = os.path.join("examples", "prototype_mtc", dirname)
return pkg_resources.resource_filename("activitysim", resource)
return str(importlib.resources.files("activitysim").joinpath(resource))


def build_data():
Expand Down
4 changes: 2 additions & 2 deletions activitysim/examples/production_semcog/test/test_semcog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

# ActivitySim
# See full license in LICENSE.txt.
import importlib.resources
import os
import subprocess

import pandas as pd
import pkg_resources

from activitysim.core.test._tools import assert_frame_substantively_equal


def run_test_semcog(multiprocess=False):
def example_path(dirname):
resource = os.path.join("examples", "production_semcog", dirname)
return pkg_resources.resource_filename("activitysim", resource)
return str(importlib.resources.files("activitysim").joinpath(resource))

def test_path(dirname):
return os.path.join(os.path.dirname(__file__), dirname)
Expand Down
4 changes: 2 additions & 2 deletions activitysim/examples/prototype_arc/test/test_arc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

# ActivitySim
# See full license in LICENSE.txt.
import importlib.resources
import os
import subprocess
import sys

import pandas as pd
import pandas.testing as pdt
import pkg_resources

from activitysim.core.test import assert_frame_substantively_equal


def _test_arc(recode=False, sharrow=False):
def example_path(dirname):
resource = os.path.join("examples", "prototype_arc", dirname)
return pkg_resources.resource_filename("activitysim", resource)
return str(importlib.resources.files("activitysim").joinpath(resource))

def test_path(dirname):
return os.path.join(os.path.dirname(__file__), dirname)
Expand Down
4 changes: 2 additions & 2 deletions activitysim/examples/prototype_marin/test/test_marin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

# ActivitySim
# See full license in LICENSE.txt.
import importlib.resources
import os
import subprocess
from pathlib import Path

import pandas as pd
import pandas.testing as pdt
import pkg_resources

from activitysim.core import test, workflow


def example_path(dirname):
resource = os.path.join("examples", "prototype_marin", dirname)
return pkg_resources.resource_filename("activitysim", resource)
return str(importlib.resources.files("activitysim").joinpath(resource))


def _test_path(dirname):
Expand Down
4 changes: 2 additions & 2 deletions activitysim/examples/prototype_mtc/test/test_mtc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@

# ActivitySim
# See full license in LICENSE.txt.
import importlib.resources
import os
import subprocess
import sys
from pathlib import Path

import pandas as pd
import pandas.testing as pdt
import pkg_resources

from activitysim.core import test, workflow


def run_test_mtc(multiprocess=False, chunkless=False, recode=False, sharrow=False):
def example_path(dirname):
resource = os.path.join("examples", "prototype_mtc", dirname)
return pkg_resources.resource_filename("activitysim", resource)
return str(importlib.resources.files("activitysim").joinpath(resource))

def test_path(dirname):
return os.path.join(os.path.dirname(__file__), dirname)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from __future__ import annotations

import argparse
import importlib.resources
import os
import shutil

import pandas as pd
import pkg_resources
import yaml

from activitysim.cli.run import add_run_args, run
Expand Down Expand Up @@ -35,12 +35,12 @@ def integer_params(params):

def base_path(dirname):
resource = os.path.join("examples", "placeholder_sandag_2_zone", dirname)
return pkg_resources.resource_filename("activitysim", resource)
return str(importlib.resources.files("activitysim").joinpath(resource))


def extended_path(dirname):
resource = os.path.join("examples", "placeholder_sandag_2_zone_extended", dirname)
return pkg_resources.resource_filename("activitysim", resource)
return str(importlib.resources.files("activitysim").joinpath(resource))


def run_model():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

# ActivitySim
# See full license in LICENSE.txt.
import importlib.resources
import os
import subprocess
import sys
from pathlib import Path

import pandas as pd
import pandas.testing as pdt
import pkg_resources
import pytest

from activitysim.core import configuration, test, workflow
Expand All @@ -23,11 +23,11 @@ def _test_prototype_mtc_extended(
):
def example_path(dirname):
resource = os.path.join("examples", "prototype_mtc_extended", dirname)
return pkg_resources.resource_filename("activitysim", resource)
return str(importlib.resources.files("activitysim").joinpath(resource))

def example_mtc_path(dirname):
resource = os.path.join("examples", "prototype_mtc", dirname)
return pkg_resources.resource_filename("activitysim", resource)
return str(importlib.resources.files("activitysim").joinpath(resource))

def test_path(dirname):
return os.path.join(os.path.dirname(__file__), dirname)
Expand Down
4 changes: 2 additions & 2 deletions activitysim/examples/prototype_mwcog/test/test_mwcog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

# ActivitySim
# See full license in LICENSE.txt.
import importlib.resources
import os
import subprocess
import sys

import pandas as pd
import pandas.testing as pdt
import pkg_resources

from activitysim.core import test


def _test_mwcog(sharrow=False):
def example_path(dirname):
resource = os.path.join("examples", "prototype_mwcog", dirname)
return pkg_resources.resource_filename("activitysim", resource)
return str(importlib.resources.files("activitysim").joinpath(resource))

def test_path(dirname):
return os.path.join(os.path.dirname(__file__), dirname)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

# ActivitySim
# See full license in LICENSE.txt.
import importlib.resources
import os
import subprocess
import sys
from pathlib import Path

import pandas as pd
import pandas.testing as pdt
import pkg_resources

from activitysim.core import workflow
from activitysim.core.test import run_if_exists
Expand All @@ -18,7 +18,7 @@
def _test_sandag_xborder(sharrow=False, mp=True):
def example_path(dirname):
resource = os.path.join("examples", "prototype_sandag_xborder", dirname)
return pkg_resources.resource_filename("activitysim", resource)
return str(importlib.resources.files("activitysim").joinpath(resource))

def test_path(dirname):
return os.path.join(os.path.dirname(__file__), dirname)
Expand Down
4 changes: 2 additions & 2 deletions test/random_seed/test_random_seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

# ActivitySim
# See full license in LICENSE.txt.
import importlib.resources
import os
import subprocess
from shutil import copytree

import pandas as pd
import pandas.testing as pdt
import pkg_resources
import yaml


Expand All @@ -35,7 +35,7 @@ def run_test_random_seed():

def example_path(dirname):
resource = os.path.join("examples", "prototype_mtc", dirname)
return pkg_resources.resource_filename("activitysim", resource)
return str(importlib.resources.files("activitysim").joinpath(resource))

def test_path(dirname):
return os.path.join(os.path.dirname(__file__), dirname)
Expand Down