Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.0 #5

Merged
merged 22 commits into from
Oct 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9a42842
Use install_requires to take care of dependencies
Mar 20, 2019
0627f68
Totally re-organized package to use a more flat structure for functio…
Mar 21, 2019
bed0179
Merge branches 'development' and 'release-1.0' of https://github.com/…
Mar 21, 2019
296a106
Updated dependencies
Mar 21, 2019
6c23d62
Pruned missing reference to old structure
Apr 8, 2019
52fbcb2
Major refactor of distance matrix to support non-square results based…
Apr 18, 2019
947bd7e
Initial commit of function to disaggrgate 2D matrices
Jul 19, 2019
effa300
Cleanup and reorg of code to work better with Sphinx documentation
Jul 19, 2019
3edd473
Updated to ignore Sphinx build files
Jul 19, 2019
8104300
Initial commit of Sphinx documentation
Jul 19, 2019
59991e7
Made some classes private to hide from documentation
Jul 31, 2019
985a107
Added a proper introduction
Aug 13, 2019
9778551
Initial commit of docstrings for the logging module
Aug 13, 2019
837e323
DOC: Corrected table formatting for docstrings
Aug 16, 2019
2dd7639
DOC: Added example tables for aggregate_matrix
Aug 16, 2019
453dcde
Updated README for 1.0 release
Aug 16, 2019
e8cb9dd
Added note about compatibility
Aug 16, 2019
af09caa
Sphinx documentation formatting updates
bccheung Aug 22, 2019
c26a1ea
Replaced the '->' arrow with a single-character unicode one to make s…
Sep 13, 2019
90c5b96
Merge branch 'release-1.0' of https://github.com/wsp-sag/balsa into r…
Sep 13, 2019
f8f2a4c
Initial commit of best_intermediate_zones function
Sep 18, 2019
0ddbeda
Initial commit of function to map sparse, duplicated zone labels into…
Sep 24, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ var/
.installed.cfg
*.egg
setup.cfg
doc/_build
doc/_static
doc/_templates

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down Expand Up @@ -90,4 +93,7 @@ ENV/
.ropeproject

# IDEA project settings
.idea
.idea

# VSCode settings
.vscode
57 changes: 48 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,51 @@
# balsa
Collection of modelling utilities. Works with both Python 2.7 and Python 3.5+
# Balsa

The current documentation can be found [on the Wiki page](https://github.com/pbsag/balsa/wiki). Some components are under construction.
Balsa is a collection of functions and tools for Python to facilitate travel demand
forecasting applications and analyses. It is designed to work the the “scientific
stack” of Python, namely NumPy, Pandas, and Matplotlib; which are optimized for speed
and usability. Most of balsa consists of standalone functions - for input/output, for
analysis, etc. - as well as a few lightweight class-based data structures for specific
applications.

## Contents:
Balsa is published by the Systems Analytics for Policy group inside WSP Canada.

## Key features

+ I/O routines to convert from binary matrix formats (INRO, OMX, and more) to
Pandas DataFrames and Series.
+ Matrix operations such as balancing, dis/aggregation, and bucket rounding.
+ Plotting functions such a Trip Length Frequency Distributions
+ Pretty Logging utilities for use in program applications
+ Management of JSON configuration files, including comments.
+ and more!

Balsa is compatible with Python 2.7 and 3.5+

## Installation

As a private package, Balsa **is not hosted on PyPI or other services that do not
permit private code**. Currently the best way to install Balsa is using `pip` to
install directly from GitHub:

`pip install git+https://github.com/wsp-sag/balsa.git`

Git will prompt you to login to your account (also works with 2FA) before installing.
This requires you to download and install a
[standalone Git client](https://git-scm.com/downloads) to communicate with GitHub.

**Windows Users:** It is recommended to install Balsa from inside an activated Conda
environment. Balsa uses several packages (NumPy, Pandas, etc.) that will otherwise
not install correctly from `pip` otherwise. For example:

```
C:\> conda activate base

(base) C:\> pip install git+https://github.com/wsp-sag/balsa.git
...
```

## Documentation

HTML documentation is available upon request - until we can find a suitable hosting
service. Just email peter.kucirek@wsp.com to request.

* __cheval__: High-performance engine for evaluating discrete-choice (logit) models over DataFrames where utilities can be specified as expressions. Works with multinomial or nested models. Also includes the LinkedDataFrame class, a subclass of Pandas DataFrame which can be linked to other data frames.
* __matrices__: Matrix balancing, as well as I/O for binary matrices.
* __pandas_utils__: Utilities (such as `fast_stack`, and `align_cateogires`) for the Pandas library
* __configuration__: Parsing and validation of JSON-based configuration files
* __scribe__: Convenient functions for logging model information during a run.
15 changes: 3 additions & 12 deletions balsa/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
import balsa.configuration
import balsa.cheval
import balsa.matrices
import balsa.pandas_utils
import balsa.utils

from balsa.cheval import LinkedDataFrame, ChoiceModel, sample_from_weights
from balsa.configuration import Config
from balsa.matrices import *
from balsa.logging import *
from balsa.pandas_utils import fast_stack, fast_unstack
from balsa.models import *
from .routines import *
from .logging import get_model_logger, init_root, log_to_file, ModelLogger
from .configuration import Config, ConfigParseError, ConfigSpecificationError, ConfigTypeError
3 changes: 0 additions & 3 deletions balsa/cheval/__init__.py

This file was deleted.

Loading