Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/AequilibraE/aequilibrae
Browse files Browse the repository at this point in the history
…into renata/528-add-support-to-more-than-one-transit-agency-in-gtfs-feeds
  • Loading branch information
r-akemii committed Sep 19, 2024
2 parents 90e3e91 + 140b293 commit 0d39439
Show file tree
Hide file tree
Showing 123 changed files with 3,158 additions and 2,332 deletions.
44 changes: 28 additions & 16 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
name: Build

on: [pull_request]
on:
push:
branches:
- 'develop'
pull_request:
release:
types: [published]


jobs:
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build SDist
run: pipx run build --sdist

# - name: Test if SDist build has all necessary pieces to be installed
# run: |
# pip3 install setuptools build --upgrade
# pip3 install dist/*.tar.gz

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand All @@ -27,20 +53,6 @@ jobs:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build SDist
run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

upload_all:
needs: [build_wheels, make_sdist]
environment: pypi
Expand All @@ -55,4 +67,4 @@ jobs:
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
- uses: pypa/gh-action-pypi-publish@release/v1
28 changes: 0 additions & 28 deletions .github/workflows/debug_tests.yml

This file was deleted.

35 changes: 21 additions & 14 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- develop
pull_request:
release:
types: [published]


jobs:
build:
Expand Down Expand Up @@ -44,30 +46,18 @@ jobs:
- name: Test docstrings
run: |
python -m pytest --doctest-modules aequilibrae/log.py aequilibrae/parameters.py aequilibrae/paths/vdf.py
python -m pytest docs/source/modeling_with_aequilibrae/project_pieces --doctest-glob=*.rst
- name: Build documentation
run: |
jupyter nbconvert --to rst docs/source/validation_benchmarking/IPF_benchmark.ipynb
jupyter nbconvert --to rst docs/source/useful_information/validation_benchmarking/IPF_benchmark.ipynb
sphinx-build -M latexpdf docs/source docs/source/_static
sphinx-build -b html docs/source docs/build
python3 -m zipfile -c AequilibraE.zip docs/build
cp AequilibraE.zip docs/source/_static
cd docs
make html
- name: Upload to DEV on S3
if: ${{ (github.event_name == 'pull_request') && (env.HAS_SECRETS == 'true') }}
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1' # optional: defaults to us-east-1
SOURCE_DIR: 'docs/build/html/' # optional: defaults to entire repository
DEST_DIR: 'python/dev/' # optional: defaults to entire repository

- name: Upload to develop branch to S3
if: ${{ (github.ref == 'refs/heads/develop') && (github.event_name == 'push') && (env.HAS_SECRETS == 'true') }}
uses: jakejarvis/s3-sync-action@master
Expand Down Expand Up @@ -123,3 +113,20 @@ jobs:
AWS_REGION: 'us-east-1' # optional: defaults to us-east-1
SOURCE_DIR: 'docs/build/htmlv/' # optional: defaults to entire repository
DEST_DIR: 'python/' # optional: defaults to entire repository

- name: Rename documentation folder to push to S3 DEV
if: ${{ (github.event_name == 'pull_request') && (env.HAS_SECRETS == 'true') }}
run: mv docs/build/html/ docs/build/${{ github.event.number }}/

- name: Upload to DEV on S3
if: ${{ (github.event_name == 'pull_request') && (env.HAS_SECRETS == 'true') }}
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1' # optional: defaults to us-east-1
SOURCE_DIR: 'docs/build/' # optional: defaults to entire repository
DEST_DIR: 'python/dev/' # optional: defaults to entire repository
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
_build
_static
_templates
docs/source/sg_execution_times.rst
docs/source/_auto_examples
docs/source/api/generated
docs/source/modeling_with_aequilibrae/project_database/data_model
docs/source/modeling_with_aequilibrae/transit_database/data_model

# User-specific stuff:
.idea/**/workspace.xml
Expand Down
5 changes: 0 additions & 5 deletions __version__.py

This file was deleted.

File renamed without changes.
23 changes: 13 additions & 10 deletions aequilibrae/matrix/aequilibrae_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ def save(self, names=(), file_name=None) -> None:
:Arguments:
**names** (:obj:`tuple(str)`, *Optional*): New names for the matrices. Required if working with OMX files
**file_name** (:obj:`str`, *Optional*): Local path to the matrix file
"""
if file_name is not None:
cores = names if len(names) else self.names
Expand Down Expand Up @@ -293,21 +295,22 @@ def create_from_omx(
Creates an AequilibraeMatrix from an original OpenMatrix
:Arguments:
**file_path** (:obj:`str`): Path for the output AequilibraEMatrix
**file_path** (:obj:`str`): Path for the output AequilibraeMatrix
**omx_path** (:obj:`str`): Path to the OMX file one wants to import
**cores** (:obj:`list`): List of matrix cores to be imported
**cores** (:obj:`list`, *Optional*): List of matrix cores to be imported
**mappings** (:obj:`list`): List of the matrix mappings (i.e. indices, centroid numbers) to be imported
**mappings** (:obj:`list`, *Optional*): List of the matrix mappings (i.e. indices, centroid numbers)
to be imported
**robust** (:obj:`bool`, *Optional*): Boolean for whether AequilibraE should try to adjust the names for cores
and indices in case they are too long. Defaults to True
**robust** (:obj:`bool`, *Optional*): Boolean for whether AequilibraE should try to adjust the names
for cores and indices in case they are too long. Defaults to ``True``
**compressed** (:obj:`bool`, *Optional*): Boolean for whether we should compress the output matrix.
Not yet implemented
**memory_only** (:obj:`bool`, *Optional*): Whether you want to keep the matrix copy in memory only. Defaults to True
**memory_only** (:obj:`bool`, *Optional*): Whether you want to keep the matrix copy in memory only. Defaults to ``True``
"""

Expand Down Expand Up @@ -405,7 +408,7 @@ def create_from_trip_list(self, path_to_file: str, from_column: str, to_column:
**from_column** (:obj:`str`): trip list file column containing the origin zones numbers
**from_column** (:obj:`str`): trip list file column containing the destination zones numbers
**to_column** (:obj:`str`): trip list file column containing the destination zones numbers
**list_cores** (:obj:`list`): list of core columns in the trip list file
Expand Down Expand Up @@ -840,7 +843,7 @@ def load(self, file_path: str):
self.__load_aem__()

def is_omx(self):
"""Returns ``True`` if matrix data source is OMX, False otherwise"""
"""Returns ``True`` if matrix data source is OMX, ``False`` otherwise"""
return self.__omx

def computational_view(self, core_list: List[str] = None):
Expand Down Expand Up @@ -920,7 +923,7 @@ def copy(
**output_name** (:obj:`str`): Name of the new matrix file.
If none is provided, returns a copy in memory only
**cores** (:obj:`list`):List of the matrix cores to be copied
**cores** (:obj:`list`): List of the matrix cores to be copied
**names** (:obj:`list`, *Optional*): List with the new names for the cores. Defaults to current names
Expand Down Expand Up @@ -1044,7 +1047,7 @@ def columns(self) -> np.ndarray:

def nan_to_num(self):
"""
Converts all NaN values in all cores in the computational view to zeros
Converts all ``NaN`` values in all cores in the computational view to zeros
.. code-block:: python
Expand Down
2 changes: 1 addition & 1 deletion aequilibrae/matrix/coo_demand.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ cdef class GeneralisedCOODemand:
dfs.append(df.dropna())

self.add_df(dfs, shape=shape, fill=fill)
logging.info(f"There {len(self.df):,} are OD pairs with non-zero flows")
logging.info(f"There are {len(self.df):,} OD pairs with non-zero flows")

def _initalise_col_names(self):
"""
Expand Down
16 changes: 12 additions & 4 deletions aequilibrae/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,24 @@


class Parameters:
"""Global parameters module
"""Global parameters module.
Parameters are used in many procedures, and are often defined in the ``parameters.yml`` file ONLY.
Parameters are used in many procedures, and are often defined only in the parameters.yml file ONLY
Parameters are organized in the following groups:
* assignment
* distribution
* network
* links
* modes
* nodes
* osm
* gmns
* osm
* system
* report zeros
* temp directory
Please observe that OSM information handled on network is not the same on the OSM group.
.. code-block:: python
Expand Down
Loading

0 comments on commit 0d39439

Please sign in to comment.