From da85b6b82e1869ab140407aa9df5a1e9bb35f813 Mon Sep 17 00:00:00 2001 From: Matt Richards Date: Sun, 14 Jul 2024 13:00:59 +1000 Subject: [PATCH 1/5] 2024 compatibility --- .../workflows/recursive_logit_integration.yml | 19 +++++++++++++- readme.rst | 24 ++++-------------- requirements_strict_2024.txt | Bin 0 -> 1042 bytes src/recursiveRouteChoice/data_loading.py | 4 +-- tests/docs/test_sioux_falls_example.py | 3 ++- tests/test_basic.py | 24 ++++++++++-------- 6 files changed, 41 insertions(+), 33 deletions(-) create mode 100644 requirements_strict_2024.txt diff --git a/.github/workflows/recursive_logit_integration.yml b/.github/workflows/recursive_logit_integration.yml index 6f97719..1d085c1 100644 --- a/.github/workflows/recursive_logit_integration.yml +++ b/.github/workflows/recursive_logit_integration.yml @@ -34,4 +34,21 @@ jobs: - name: Test with pytest run: | pip install -e . - pytest --ignore=src/ --ignore=manual_verification/ + pytest -v --color=yes --ignore=src/ --ignore=manual_verification/ + + test2024: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.10 + + - name: Install dependencies + run: | + python -m pip install uv + uv pip install -r requirements_strict_2024.txt flake8 pytest -e . + + - name: Test with pytest + run: | + pytest -v --color=yes --ignore=src/ --ignore=manual_verification/ diff --git a/readme.rst b/readme.rst index 0728584..bc68a9b 100644 --- a/readme.rst +++ b/readme.rst @@ -10,30 +10,16 @@ quick start overview. Installation ------------ -The current most direct method of installation is to clone the repository and install using pip:: - - pip install -r requirements.txt - -Note that (currently) on windows the 2004 update has broken some interactions with OpenBLAS. To -avoid any problems it is recommended to use conda, which will use MKL BLAS and avoid any issues:: - conda install --file (cat requirements.txt) +(This was all written back in 2020, and python packaging workflow tools have come a long way since then, +more modern workflow tools like pixi, rye, pdm etc could be considered. ) -Note that there are no direct problems related to this in the code but -pip will install numpy 1.19.4 by default, which will -immediately crash to warn about this. Reverting to numpy 1.19.3 "fixes" this in that the warning -isn't triggered, but other code which does require on the broken functionality may silently fail. - -.. - Currently one can install from the repository directly using pip:: +The current most direct method of installation is to clone the repository and install using pip:: - pip install git+https://github.com/m-richards/RecursiveLogit.git + python -m virtualenv venv + python -m pip install -r requirements_strict_2024.txt -It is recommended to use some kind of virtual environment to avoid conflicting package versions. -There is also a :code:`requirements_strict.txt` which explicitly specifies package versions. This -will likely contain less up to date versions, but should always work regardless of future -api changes of the dependencies. Example Usage ------------- diff --git a/requirements_strict_2024.txt b/requirements_strict_2024.txt new file mode 100644 index 0000000000000000000000000000000000000000..2c477f9a63ac7c9020d59b416216bd39231de123 GIT binary patch literal 1042 zcmaiz;cDAJ5QOJ#`-j!YXgYCyGC5ByvA_^)Gjurl_`8@?9g z3O!3QjWy)E)6B~eyI|0r^2g3vxbDeX_vr3>5e(gvYbJW=_#L>v&K>7G>3gg}v!aiu zTGxHQ*2Xw_LK*qkM-6Ib#uF-@ML$WOLivrp>I>!`lfL!O4YgLFTfHsbttQOSYHsM+ z+tqP<8&li!-r@Vj+b!{CS?hajsWWPD2K0M2Z4S>0lqsGoo=c{kt>k6}_9YuoF|!qR z&6#qy;O+`D!UcB)QA?eZVTEtt;0=18i?#2FY)(`6T#DGZte<;1gnHTI? Date: Mon, 27 Jan 2025 15:01:52 +1100 Subject: [PATCH 2/5] Update .github/workflows/recursive_logit_integration.yml --- .github/workflows/recursive_logit_integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/recursive_logit_integration.yml b/.github/workflows/recursive_logit_integration.yml index 1d085c1..a486738 100644 --- a/.github/workflows/recursive_logit_integration.yml +++ b/.github/workflows/recursive_logit_integration.yml @@ -42,7 +42,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: 3.10 + python-version: '3.10' - name: Install dependencies run: | From 1bf910a5e71c51036351d9aae635100e0b203e1f Mon Sep 17 00:00:00 2001 From: Matt Richards <45483497+m-richards@users.noreply.github.com> Date: Mon, 27 Jan 2025 17:20:56 +1100 Subject: [PATCH 3/5] Update requirements_strict_2024.txt --- requirements_strict_2024.txt | Bin 1042 -> 398 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/requirements_strict_2024.txt b/requirements_strict_2024.txt index 2c477f9a63ac7c9020d59b416216bd39231de123..4801b4db7dce96e34077c546341a78d7dd5e8733 100644 GIT binary patch literal 398 zcmYL_L2iRE5JmS$+ySX;Mm8a+S@;gQLF5{TS^?X_g92Qwiyo<0=!{X*<@fw~|9gJE zzTc|rhM&P#Cy)ZpWuc#sr=EMI8t9;V>Dt7o)alpkr?j>)Olxuzq^5p^)EIJk#rqMA&uphTbwQhDr>k}P;IuR$w;(q+`552p5RFD_G&o4)+ Ba=!oo literal 1042 zcmaiz;cDAJ5QOJ#`-j!YXgYCyGC5ByvA_^)Gjurl_`8@?9g z3O!3QjWy)E)6B~eyI|0r^2g3vxbDeX_vr3>5e(gvYbJW=_#L>v&K>7G>3gg}v!aiu zTGxHQ*2Xw_LK*qkM-6Ib#uF-@ML$WOLivrp>I>!`lfL!O4YgLFTfHsbttQOSYHsM+ z+tqP<8&li!-r@Vj+b!{CS?hajsWWPD2K0M2Z4S>0lqsGoo=c{kt>k6}_9YuoF|!qR z&6#qy;O+`D!UcB)QA?eZVTEtt;0=18i?#2FY)(`6T#DGZte<;1gnHTI? Date: Mon, 27 Jan 2025 17:37:14 +1100 Subject: [PATCH 4/5] Update .github/workflows/recursive_logit_integration.yml --- .github/workflows/recursive_logit_integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/recursive_logit_integration.yml b/.github/workflows/recursive_logit_integration.yml index a486738..99268d6 100644 --- a/.github/workflows/recursive_logit_integration.yml +++ b/.github/workflows/recursive_logit_integration.yml @@ -47,7 +47,7 @@ jobs: - name: Install dependencies run: | python -m pip install uv - uv pip install -r requirements_strict_2024.txt flake8 pytest -e . + uv pip install --system -r requirements_strict_2024.txt flake8 pytest -e . - name: Test with pytest run: | From 0075405a37a1b784b18a85a8badebfa0e8d69f3d Mon Sep 17 00:00:00 2001 From: Matt Richards <45483497+m-richards@users.noreply.github.com> Date: Mon, 27 Jan 2025 18:16:01 +1100 Subject: [PATCH 5/5] Update recursive_logit_integration.yml --- .../workflows/recursive_logit_integration.yml | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/.github/workflows/recursive_logit_integration.yml b/.github/workflows/recursive_logit_integration.yml index 99268d6..2fb1aa6 100644 --- a/.github/workflows/recursive_logit_integration.yml +++ b/.github/workflows/recursive_logit_integration.yml @@ -10,32 +10,6 @@ on: branches: [ master ] jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - pip install -e . - pytest -v --color=yes --ignore=src/ --ignore=manual_verification/ - test2024: runs-on: ubuntu-latest steps: