Repository: mie-lab/trackintel (language: python)

Issue:
BUG/TST: Github action failed
Our daily GitHub action failed 8 days ago when we had our last pull request. 
I suspect that some changes from #361 is causing the error.



Discussion / hints:
Looks to me like it is only the codecov failing because I did not have a test for the case `if_crs_planar`. See [here](https://codecov.io/gh/mie-lab/trackintel/commit/1ff2323c868cfb82c0d0497cf57281c821e044d1#D4-37)
We can add a test for that and see if the problem is resolved
> 

Ahh okay. I was more thinking of the scheduled tests - if you click on Actions you can see an array of failed scheduled tests since 7 days ago. The error message reads: `The job running on runner Hosted Agent has exceeded the maximum execution time of 360 minutes.` while our tests last usually ~15min

I don't know where the error comes from but suspect that we might have changed something in the last commit. But it also could be an error from the Github Action itself.
> > 
> 
> Ahh okay. I was more thinking of the scheduled tests - if you click on Actions you can see an array of failed scheduled tests since 7 days ago. The error message reads: `The job running on runner Hosted Agent has exceeded the maximum execution time of 360 minutes.` while our tests last usually ~15min
> 
> I don't know where the error comes from but suspect that we might have changed something in the last commit. But it also could be an error from the Github Action itself.

I think the error comes from somewhere else than our PR. My fork has not yet integrated the last PR but still have these failed test since 7 days ago
seems we are still having the same issue. I am reopening this.

Fix patch:
diff --git a/README.md b/README.md
index e928092f..af9b6bcd 100644
--- a/README.md
+++ b/README.md
@@ -117,7 +117,6 @@ ti.print_version()
 * tqdm
 * OSMnx
 * similaritymeasures
-* pygeos
 
 ## Development
 You can find the development roadmap under `ROADMAP.md` and further development guidelines under `CONTRIBUTING.md`.
diff --git a/docs/conf.py b/docs/conf.py
index 5f1b44c7..f45b44a0 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -50,7 +50,6 @@
     "geoalchemy2",
     "tqdm",
     "similaritymeasures",
-    "pygeos",
 ]
 
 
diff --git a/docs/environment.yml b/docs/environment.yml
index 9957364f..1392606b 100644
--- a/docs/environment.yml
+++ b/docs/environment.yml
@@ -19,4 +19,3 @@ dependencies:
   - sphinx_rtd_theme
   - tqdm
   - similaritymeasures
-  - pygeos
diff --git a/environment.yml b/environment.yml
index e13e8f79..775c6bdb 100644
--- a/environment.yml
+++ b/environment.yml
@@ -17,4 +17,3 @@ dependencies:
 - psycopg2
 - tqdm
 - similaritymeasures
-- pygeos
diff --git a/requirements.txt b/requirements.txt
index fe00f6db..3297999c 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -9,5 +9,4 @@ geoalchemy2
 osmnx 
 psycopg2
 tqdm
-similaritymeasures
-pygeos
\ No newline at end of file
+similaritymeasures
\ No newline at end of file
diff --git a/setup.py b/setup.py
index 98a920f4..bc20126d 100644
--- a/setup.py
+++ b/setup.py
@@ -33,7 +33,6 @@
     "scikit-learn",
     "tqdm",
     "similaritymeasures",
-    "pygeos",
 ]
 
 install_requires = [
@@ -49,7 +48,6 @@
     "tqdm",
     "geopandas",
     "similaritymeasures",
-    "pygeos",
 ]
 
 # What packages are optional?


Test patch:
diff --git a/.github/envs/conda-forge-env.yaml b/.github/envs/39-latest-conda-forge.yaml
similarity index 80%
rename from .github/envs/conda-forge-env.yaml
rename to .github/envs/39-latest-conda-forge.yaml
index 6de281d8..dde6bd2d 100644
--- a/.github/envs/conda-forge-env.yaml
+++ b/.github/envs/39-latest-conda-forge.yaml
@@ -1,12 +1,13 @@
 name: test
 channels:
   - conda-forge
-  - defaults
 dependencies:
+- python=3.9
+
+# required
 - matplotlib
 - numpy
-- pandas<=1.2.5
-- geopandas
+- pandas
 - scikit-learn
 - networkx 
 - pint
@@ -14,10 +15,15 @@ dependencies:
 - geoalchemy2 
 - osmnx 
 - psycopg2
-- pytest
-- pytest-cov
-- pytest-xdist
 - tqdm
 - similaritymeasures
-- pygeos
 - jupyter
+- geopandas
+- shapely
+
+# tests
+- pytest
+- pytest-cov
+- pytest-xdist
+
+  
diff --git a/.github/workflows/CI-tests.yml b/.github/workflows/CI-tests.yml
index 8fd76392..4cd2c281 100644
--- a/.github/workflows/CI-tests.yml
+++ b/.github/workflows/CI-tests.yml
@@ -11,12 +11,18 @@ on:
 
 jobs:
   ubuntu-latest:
-    name: ${{ matrix.os }}, ${{ matrix.python-version }}
+    name: ${{ matrix.os }}, ${{ matrix.env }}
     runs-on: ${{ matrix.os }}   
+    defaults:
+      run:
+        shell: bash -l {0}
     strategy:
+      fail-fast: false
       matrix:
         os: [ubuntu-latest, macos-latest, windows-latest]
-        python-version: ["3.8", "3.9"]
+        env: 
+          - .github/envs/39-latest-conda-forge.yaml
+
       
     steps:
     - uses: actions/checkout@v2
@@ -24,20 +30,24 @@ jobs:
     - name: Set up Python environment
       uses: conda-incubator/setup-miniconda@v2
       with:
-          activate-environment: test
-          environment-file: .github/envs/conda-forge-env.yaml
-          python-version: ${{ matrix.python-version }}
-          auto-activate-base: false
+          environment-file: ${{ matrix.env }}
+          miniforge-version: latest
+          miniforge-variant: Mambaforge
+          use-mamba: true
+          
+    - name: Check Environment
+      run: |
+        python -V
+        python -c "import trackintel; trackintel.print_version();"
+        conda info
 
     - name: Test with pytest
-      shell: bash -l {0}
       run: |
-        pytest -v -r s -n auto --color=yes --cov=trackintel --cov-append --cov-report term-missing --cov-report xml tests/
+        pytest -v -r s --color=yes --cov=trackintel --cov-append --cov-report term-missing --cov-report xml tests/
 
   
     - name: Test with PostGIS
-      shell: bash -l {0}
-      if: contains(matrix.python-version, '3.8') && contains(matrix.os, 'ubuntu')
+      if: contains(matrix.env, '39-latest-conda-forge.yaml') && contains(matrix.os, 'ubuntu')
       env:
         PGUSER: postgres
         PGPASSWORD: postgres
@@ -48,5 +58,5 @@ jobs:
         pytest -v -r s --color=yes --cov=trackintel --cov-append --cov-report term-missing --cov-report xml tests/io/test_postgis.py | tee /dev/stderr | if grep SKIPPED >/dev/null;then echo "TESTS SKIPPED, FAILING" && exit 1;fi
 
     - name: Codecov report
-      if: contains(matrix.python-version, '3.8') && contains(matrix.os, 'ubuntu')
+      if: contains(matrix.env, '39-latest-conda-forge.yaml') && contains(matrix.os, 'ubuntu')
       uses: codecov/codecov-action@v1
\ No newline at end of file
diff --git a/tests/analysis/test_location_identification.py b/tests/analysis/test_location_identification.py
index b1da99de..3cbfe50a 100644
--- a/tests/analysis/test_location_identification.py
+++ b/tests/analysis/test_location_identification.py
@@ -418,22 +418,22 @@ def test_prior_activity_label(self, example_osna):
         example_osna.loc[example_osna["location_id"] == 1, "purpose"] = "work"
         assert_geodataframe_equal(example_osna, result)
 
-    def test_multiple_users_with_only_one_location(self):
-        """Test that function can handle multiple users with only one location."""
-        t_leis = pd.Timestamp("2021-07-14 01:00:00", tz="utc")
-        t_work = pd.Timestamp("2021-07-14 18:00:00", tz="utc")
-        h = pd.Timedelta("1h")
-        list_dict = [
-            {"user_id": 0, "location_id": 0, "started_at": t_leis, "finished_at": t_leis + h},
-            {"user_id": 0, "location_id": 1, "started_at": t_work, "finished_at": t_work + h},
-            {"user_id": 1, "location_id": 0, "started_at": t_leis, "finished_at": t_leis + h},
-            {"user_id": 2, "location_id": 0, "started_at": t_work, "finished_at": t_work + h},
-        ]
-        sp = pd.DataFrame(list_dict)
-        sp.index.name = "id"
-        result = osna_method(sp)
-        sp["purpose"] = ["home", "work", "home", "work"]
-        assert_frame_equal(sp, result)
+    # def test_multiple_users_with_only_one_location(self):
+    #     """Test that function can handle multiple users with only one location."""
+    #     t_leis = pd.Timestamp("2021-07-14 01:00:00", tz="utc")
+    #     t_work = pd.Timestamp("2021-07-14 18:00:00", tz="utc")
+    #     h = pd.Timedelta("1h")
+    #     list_dict = [
+    #         {"user_id": 0, "location_id": 0, "started_at": t_leis, "finished_at": t_leis + h},
+    #         {"user_id": 0, "location_id": 1, "started_at": t_work, "finished_at": t_work + h},
+    #         {"user_id": 1, "location_id": 0, "started_at": t_leis, "finished_at": t_leis + h},
+    #         {"user_id": 2, "location_id": 0, "started_at": t_work, "finished_at": t_work + h},
+    #     ]
+    #     sp = pd.DataFrame(list_dict)
+    #     sp.index.name = "id"
+    #     result = osna_method(sp)
+    #     sp["purpose"] = ["home", "work", "home", "work"]
+    #     assert_frame_equal(sp, result)
 
 
 class Test_osna_label_timeframes:
diff --git a/tests/preprocessing/test_triplegs.py b/tests/preprocessing/test_triplegs.py
index d10bd769..31ea27a5 100644
--- a/tests/preprocessing/test_triplegs.py
+++ b/tests/preprocessing/test_triplegs.py
@@ -284,22 +284,22 @@ def test_generate_trips_gap_detection(self):
         # test if generated staypoints/triplegs are equal (especially important for trip ids)
         assert_frame_equal(sp_tpls_loaded, sp_tpls, check_dtype=False)
 
-    def test_generate_trips_id_management(self, example_triplegs_higher_gap_threshold):
-        """Test if we can generate the example trips based on example data."""
-        sp_tpls_loaded = pd.read_csv(os.path.join("tests", "data", "geolife_long", "sp_tpls.csv"), index_col="id")
-        sp_tpls_loaded["started_at"] = pd.to_datetime(sp_tpls_loaded["started_at"])
-        sp_tpls_loaded["started_at_next"] = pd.to_datetime(sp_tpls_loaded["started_at_next"])
-        sp_tpls_loaded["finished_at"] = pd.to_datetime(sp_tpls_loaded["finished_at"])
-
-        sp, tpls = example_triplegs_higher_gap_threshold
-
-        # generate trips and a joint staypoint/triplegs dataframe
-        gap_threshold = 15
-        sp, tpls, _ = generate_trips(sp, tpls, gap_threshold=gap_threshold)
-        sp_tpls = _create_debug_sp_tpls_data(sp, tpls, gap_threshold=gap_threshold)
-
-        # test if generated staypoints/triplegs are equal (especially important for trip ids)
-        assert_frame_equal(sp_tpls_loaded, sp_tpls, check_dtype=False)
+    # def test_generate_trips_id_management(self, example_triplegs_higher_gap_threshold):
+    #     """Test if we can generate the example trips based on example data."""
+    #     sp_tpls_loaded = pd.read_csv(os.path.join("tests", "data", "geolife_long", "sp_tpls.csv"), index_col="id")
+    #     sp_tpls_loaded["started_at"] = pd.to_datetime(sp_tpls_loaded["started_at"])
+    #     sp_tpls_loaded["started_at_next"] = pd.to_datetime(sp_tpls_loaded["started_at_next"])
+    #     sp_tpls_loaded["finished_at"] = pd.to_datetime(sp_tpls_loaded["finished_at"])
+
+    #     sp, tpls = example_triplegs_higher_gap_threshold
+
+    #     # generate trips and a joint staypoint/triplegs dataframe
+    #     gap_threshold = 15
+    #     sp, tpls, _ = generate_trips(sp, tpls, gap_threshold=gap_threshold)
+    #     sp_tpls = _create_debug_sp_tpls_data(sp, tpls, gap_threshold=gap_threshold)
+
+    #     # test if generated staypoints/triplegs are equal (especially important for trip ids)
+    #     assert_frame_equal(sp_tpls_loaded, sp_tpls, check_dtype=False)
 
     def test_only_staypoints_in_trip(self):
         """Test that trips with only staypoints (non-activities) are deleted."""