From 03df9e40f69094bfc2b5bd25543b829ceac64c0e Mon Sep 17 00:00:00 2001 From: Ilya Sytchev Date: Thu, 21 Nov 2024 17:39:01 -0500 Subject: [PATCH] Unpin versions of development dependencies --- .flake8 | 2 ++ forest/bonsai/tests/test_simulate_gps_data.py | 8 ++++---- forest/jasmine/tests/test_traj2stats.py | 14 +++++++------- forest/oak/tests/test_preprocess_dates.py | 2 +- forest/oak/tests/test_run_hourly.py | 2 +- forest/poplar/tests/test_poplar_functions.py | 2 +- forest/sycamore/tests/test_functions.py | 6 +++--- pyproject.toml | 18 +++++++++--------- 8 files changed, 28 insertions(+), 26 deletions(-) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..df9a9c13 --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +exclude = .venv diff --git a/forest/bonsai/tests/test_simulate_gps_data.py b/forest/bonsai/tests/test_simulate_gps_data.py index c95cc530..e7f64504 100644 --- a/forest/bonsai/tests/test_simulate_gps_data.py +++ b/forest/bonsai/tests/test_simulate_gps_data.py @@ -282,7 +282,7 @@ def test_get_path_close_locations(coords1, coords3): == 2) -@pytest.fixture() +@pytest.fixture def random_path(directions1, coords1, coords2): lat1, lon1 = coords1 lat2, lon2 = coords2 @@ -507,7 +507,7 @@ def test_person_office_days(sample_coordinates, sample_locations, assert len(random_person.office_days) <= 5 -@pytest.fixture() +@pytest.fixture def sample_person(sample_coordinates, sample_locations, sample_attributes): user_attrs = sample_attributes["User 5"] attributes = Attributes(**user_attrs) @@ -804,7 +804,7 @@ def test_gen_all_traj_dist_travelled(sample_person, mocker): assert np.all(total_d_list >= 0) -@pytest.fixture() +@pytest.fixture def generated_trajectory(sample_person, mocker): mocker.patch( "forest.bonsai.simulate_gps_data.get_path", side_effect=mock_get_path @@ -869,7 +869,7 @@ def test_load_attributes_switches(sample_attributes): assert switches[5]["travelling_status-20"] == 1 -@pytest.fixture() +@pytest.fixture def sample_addresses(): return np.array( [ diff --git a/forest/jasmine/tests/test_traj2stats.py b/forest/jasmine/tests/test_traj2stats.py index 156bac89..ef1ad7af 100644 --- a/forest/jasmine/tests/test_traj2stats.py +++ b/forest/jasmine/tests/test_traj2stats.py @@ -12,12 +12,12 @@ ) -@pytest.fixture() +@pytest.fixture def coords1(): return 51.457183, -2.597960 -@pytest.fixture() +@pytest.fixture def coords2(): return 51.457267, -2.598045 @@ -54,7 +54,7 @@ def test_transform_point_to_circle_radius(coords1): assert 4 <= distance <= 5 -@pytest.fixture() +@pytest.fixture def sample_trajectory(): """16 minutes of a random trajectory""" return np.array( @@ -153,7 +153,7 @@ def sample_trajectory(): ) -@pytest.fixture() +@pytest.fixture def sample_nearby_locations(): ids = { "post_box": [560374554], @@ -480,7 +480,7 @@ def test_gps_summaries_pcr( assert summary["physical_circadian_rhythm_stratified"].iloc[1] == 0 -@pytest.fixture() +@pytest.fixture def mobmat1(): """mobility matrix 1""" return np.array( @@ -494,7 +494,7 @@ def mobmat1(): ) -@pytest.fixture() +@pytest.fixture def mobmat2(): """mobility matrix 2""" return np.array( @@ -508,7 +508,7 @@ def mobmat2(): ) -@pytest.fixture() +@pytest.fixture def mobmat3(): """mobility matrix 3""" return np.array( diff --git a/forest/oak/tests/test_preprocess_dates.py b/forest/oak/tests/test_preprocess_dates.py index f4017c0a..852ba35a 100644 --- a/forest/oak/tests/test_preprocess_dates.py +++ b/forest/oak/tests/test_preprocess_dates.py @@ -5,7 +5,7 @@ from forest.oak.base import preprocess_dates -@pytest.fixture() +@pytest.fixture def sample_file_list(): return [ '2023-11-01 00_00_00+00_00.csv', '2023-11-01 01_00_00+00_00.csv', diff --git a/forest/oak/tests/test_run_hourly.py b/forest/oak/tests/test_run_hourly.py index 3c392655..cc5d39a5 100644 --- a/forest/oak/tests/test_run_hourly.py +++ b/forest/oak/tests/test_run_hourly.py @@ -6,7 +6,7 @@ from forest.constants import Frequency -@pytest.fixture() +@pytest.fixture def sample_run_input(signal_bout): t_hours_pd = pd.Series(pd.to_datetime([ "2020-02-25 08:00:00-05:00", diff --git a/forest/poplar/tests/test_poplar_functions.py b/forest/poplar/tests/test_poplar_functions.py index bb1f4e66..00202767 100644 --- a/forest/poplar/tests/test_poplar_functions.py +++ b/forest/poplar/tests/test_poplar_functions.py @@ -131,7 +131,7 @@ def test_get_files_timestamps(): # Testing functions in forest.poplar.functions.helpers -@pytest.fixture() +@pytest.fixture def gps_df(): return read_data("idr8gqdh", TEST_DATA_DIR, "gps", "America/New_York", time_start=[2021, 12, 15, 20, 9, 50], diff --git a/forest/sycamore/tests/test_functions.py b/forest/sycamore/tests/test_functions.py index cd879549..aa3140ca 100644 --- a/forest/sycamore/tests/test_functions.py +++ b/forest/sycamore/tests/test_functions.py @@ -51,19 +51,19 @@ SEP_QS_DIR = os.path.join(TEST_DATA_DIR, "dir_with_seps_in_qs") -@pytest.fixture() +@pytest.fixture def agg_data_config(): return aggregate_surveys_config(SAMPLE_DIR, SURVEY_SETTINGS_PATH, "UTC", users=["16au2moz", "idr8gqdh"]) -@pytest.fixture() +@pytest.fixture def agg_data_no_config(): return aggregate_surveys_no_config(SAMPLE_DIR, study_tz="UTC", users=["16au2moz", "idr8gqdh"]) -@pytest.fixture() +@pytest.fixture def submits_data(): agg_data = aggregate_surveys_config( SAMPLE_DIR, SURVEY_SETTINGS_PATH_FOR_SUBMITS, study_tz="UTC", diff --git a/pyproject.toml b/pyproject.toml index e55c0244..c02b9317 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,16 +34,16 @@ Homepage = "https://github.com/onnela-lab/forest" [project.optional-dependencies] dev = [ "build", - "flake8==6.1.0", - "flake8-pytest-style==1.7.2", - "mypy==1.6.1", - "pytest==7.4.3", - "pytest-mock==3.12.0", + "flake8", + "flake8-pytest-style", + "mypy", + "pytest", + "pytest-mock", "twine", - "types-python-dateutil==2.8.19.14", - "types-pytz==2023.3.1.1", - "types-requests==2.31.0.10", - "types-setuptools==68.2.0.0" + "types-python-dateutil", + "types-pytz", + "types-requests", + "types-setuptools", ] [tool.setuptools.packages.find]