https://github.com/arup-group/genet

Manipulate MATSim networks via a Python API.

https://github.com/arup-group/genet

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.2%) to scientific vocabulary

Keywords

arup city-modelling city-modelling-lab cml network
Last synced: 6 months ago · JSON representation

Repository

Manipulate MATSim networks via a Python API.

Basic Info
  • Host: GitHub
  • Owner: arup-group
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 50.3 MB
Statistics
  • Stars: 49
  • Watchers: 10
  • Forks: 11
  • Open Issues: 43
  • Releases: 5
Topics
arup city-modelling city-modelling-lab cml network
Created almost 6 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct

README.md

Network Scenario Generator (GeNet)

DOI Ask DeepWiki

GeNet provides tools to represent and work with a multi-modal transport network with public transport (PT) services. It is based on MATSim's representation of such networks.

The goal of GeNet is to:

  • Provide a formalised in-memory data structure for representing a multi-modal network with a PT service
  • Enable using the data structure for tasks such as generating auxiliary MATSim files e.g. Road Pricing
  • Simplify the process of modifying a network and provide a simple change log to track the differences between the input and output networks.
  • Provide validation methods to check for simple errors such as: whether a Route has more than one Stop or that the underlying graph doesn't have any dead-ends or sources (a place which you can leave but cannot get back to).

The underlying network available to PT services (roads, railways, but also ferry/flight connections) uses a networkx.MultiDiGraph with additional methods for 'links' which are unique in genet.Network (networkx.MultiDiGraph accepts multiple edges between the same from and to node pair; referring to an edge in networkx.MultiDiGraph and genet.Network has the same effects, i.e. the result is a dictionary indexed by the multi edge index). The PT services are represented through the genet.Schedule class which relies on other genet classes: the Schedule relies on a list of genet.Service's, which in turn consists of a list of genet.Route's. Each Route class object has an attribute stops which consists of genet.Stops objects. The Stops carry spatial information for the PT stop.

You can use GeNet's CLI to run pre-baked modifications or checks on networks. You can also write your own python scripts, importing genet as a package, use IPython shell or Jupyter Notebook to load up a network, inspect or change it and save it out to file.

Documentation

For more detailed instructions, see our documentation. We also autogenerate queryable documentation using DeepWiki; you can find that here.

Installation

If you do not plan to make any code changes, you can install GeNet as a Docker image or a Python package.

For more detailed instructions, see our documentation.

As a Docker image

shell git clone git@github.com:arup-group/genet.git cd genet docker build -t "cml-genet" . <!--- --8<-- [end:docs-install-docker] -->

As a Python package

To install genet (indexed online as cml-genet), we recommend using the mamba package manager:

shell git clone git@github.com:arup-group/genet.git cd genet mamba create -n genet -c conda-forge -c city-modelling-lab --file requirements/base.txt mamba activate genet pip install --no-deps . <!--- --8<-- [end:docs-install-user] -->

Contributing

There are many ways to contribute to genet. Before making contributions to the genet source code, see our contribution guidelines and follow the development install instructions.

If you plan to make changes to the code then please make regular use of the following tools to verify the codebase while you work:

  • pre-commit: run pre-commit install in your command line to load inbuilt checks that will run every time you commit your changes. The checks are: 1. check no large files have been staged, 2. lint python files for major errors, 3. format python files to conform with the pep8 standard. You can also run these checks yourself at any time to ensure staged changes are clean by simple calling pre-commit.
  • pytest - run the unit test suite and check test coverage.

For more information, see our documentation.

Installing a development environment

shell git clone git@github.com:arup-group/genet.git cd genet mamba create -n genet -c conda-forge -c city-modelling-lab --file requirements/base.txt --file requirements/dev.txt mamba activate genet pip install --no-deps -e . ipython kernel install --user --name=genet <!--- --8<-- [end:docs-install-dev] -->

Building the documentation

If you are unable to access the online documentation, you can build the documentation locally. First, install a development environment of genet, then deploy the documentation using mike:

mike deploy develop mike serve

Then you can view the documentation in a browser at http://localhost:8000/.

Credits

This package was created with Cookiecutter and the arup-group/cookiecutter-pypackage project template.

Owner

  • Name: Arup
  • Login: arup-group
  • Kind: organization
  • Email: media@arup.com

We Shape a Better World

GitHub Events

Total
  • Issues event: 19
  • Watch event: 8
  • Delete event: 7
  • Issue comment event: 4
  • Push event: 40
  • Pull request review comment event: 19
  • Pull request review event: 20
  • Pull request event: 12
  • Fork event: 2
  • Create event: 8
Last Year
  • Issues event: 19
  • Watch event: 8
  • Delete event: 7
  • Issue comment event: 4
  • Push event: 40
  • Pull request review comment event: 19
  • Pull request review event: 20
  • Pull request event: 12
  • Fork event: 2
  • Create event: 8

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 71
  • Total pull requests: 139
  • Average time to close issues: 6 months
  • Average time to close pull requests: 27 days
  • Total issue authors: 12
  • Total pull request authors: 10
  • Average comments per issue: 0.55
  • Average comments per pull request: 0.63
  • Merged pull requests: 124
  • Bot issues: 0
  • Bot pull requests: 17
Past Year
  • Issues: 15
  • Pull requests: 9
  • Average time to close issues: 3 days
  • Average time to close pull requests: 1 day
  • Issue authors: 6
  • Pull request authors: 2
  • Average comments per issue: 0.07
  • Average comments per pull request: 0.11
  • Merged pull requests: 7
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • KasiaKoz (27)
  • mfitz (12)
  • brynpickering (9)
  • fredshone (6)
  • neilmt (4)
  • gac55 (3)
  • Arupwkeu (2)
  • Dominic-Duke (2)
  • ana-kop (1)
  • pedrocamargo (1)
  • cfram (1)
  • elizabethc-arup (1)
Pull Request Authors
  • KasiaKoz (83)
  • mfitz (21)
  • brynpickering (20)
  • dependabot[bot] (13)
  • gac55 (4)
  • pre-commit-ci[bot] (4)
  • ana-kop (2)
  • alex-andrey (2)
  • syhwawa (1)
  • cfram (1)
Top Labels
Issue Labels
enhancement (26) bug (17) good first issue (6) help wanted (1) documentation (1)
Pull Request Labels
dependencies (13) bug (2)

Dependencies

.github/workflows/build_pipeline.yml actions
  • actions/cache v1 composite
  • actions/checkout v2 composite
  • actions/setup-python v1 composite
  • aws-actions/configure-aws-credentials v1 composite
  • rtCamp/action-slack-notify v2.0.0 composite
.github/workflows/daily-scheduled-ci.yml actions
  • actions/cache v1 composite
  • actions/checkout v3 composite
  • actions/setup-python v1 composite
  • rtCamp/action-slack-notify v2.0.0 composite
Dockerfile docker
  • python 3.7-slim-stretch build
requirements.txt pypi
  • PyUtilib >=5.8.0
  • PyYAML ==5.4
  • Pygments ==2.7.4
  • Pyomo ==5.7.3
  • Rtree ==0.9.4
  • Shapely ==1.7.1
  • anytree ==2.8.0
  • appdirs ==1.4.4
  • appnope ==0.1.0
  • attrs ==19.3.0
  • backcall ==0.1.0
  • boto3 ==1.14.16
  • botocore ==1.17.16
  • certifi ==2022.12.7
  • chardet ==3.0.4
  • cligj ==0.5.0
  • colorama ==0.4.4
  • coverage >=5.1
  • cycler ==0.10.0
  • decorator ==4.4.2
  • descartes ==1.1.0
  • dictdiffer ==0.8.1
  • docutils ==0.15.2
  • flake8 >=3.8.4
  • future ==0.18.2
  • geopandas ==0.9.0
  • idna ==2.9
  • importlib-metadata ==1.6.0
  • ipykernel ==5.3.0
  • ipython ==7.16.3
  • ipython-genutils ==0.2.0
  • jedi ==0.17.0
  • jmespath ==0.10.0
  • jupyter-client ==6.1.5
  • jupyter-core ==4.11.2
  • keplergl ==0.3.2
  • kiwisolver ==1.2.0
  • lxml >=4.6.2
  • matplotlib ==3.2.1
  • memory-profiler ==0.57.0
  • more-itertools ==8.3.0
  • munch ==2.5.0
  • nbconvert ==6.5.1
  • networkx ==2.4
  • nose ==1.3.7
  • numpy >=1.18.4
  • osmnx ==0.15.0
  • packaging ==20.4
  • pandas ==1.3.3
  • parso ==0.7.0
  • pexpect ==4.8.0
  • pickleshare ==0.7.5
  • pluggy ==0.13.1
  • ply ==3.11
  • polyline ==1.4.0
  • prompt-toolkit ==3.0.5
  • protobuf ==3.19.5
  • ptyprocess ==0.6.0
  • py >=1.8.1
  • pyparsing ==2.4.7
  • pyproj >=3.1.0
  • pytest >=6.0.0
  • pytest-cov >=2.0.0
  • pytest-mock >=3.0.0
  • pytest-xdist >=2.0.0
  • python-dateutil ==2.8.1
  • pytz ==2020.1
  • pyzmq ==19.0.1
  • requests ==2.26.0
  • requests-futures ==1.0.0
  • rich ==12.5.1
  • rioxarray ==0.9.1
  • s2sphere ==0.2.5
  • s3transfer ==0.3.3
  • scikit-learn ==0.24.2
  • six ==1.14.0
  • tabulate ==0.8.7
  • tornado ==6.1
  • tqdm ==4.48.0
  • traitlets ==5.1.1
  • urllib3 >=1.25.1
  • wcwidth ==0.1.9
  • wheel ==0.36.2
  • xmltodict ==0.12.0
  • zipp ==3.1.0
setup.py pypi