Skip to content

Commit

Permalink
Merge pull request #53 from UDST/dev
Browse files Browse the repository at this point in the history
Finalizing v1.5.4 release
  • Loading branch information
smmaurer authored Nov 9, 2020
2 parents 28f67c0 + 6328ff0 commit 0a41626
Show file tree
Hide file tree
Showing 19 changed files with 90 additions and 60 deletions.
8 changes: 1 addition & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ python:
- '3.5'
- '3.6'
- '3.7'
# - '3.8' broken because PyTables binaries aren't available yet
- '3.8'

install:
- pip install .
- pip install pytest-cov coveralls pycodestyle
- pip install flask pygments # for server component tests
- bin/build_js_bundle.sh complete
- pip install numpydoc sphinx sphinx_rtd_theme # for building docs
- pip list
- pip show orca

Expand All @@ -22,8 +21,3 @@ script:

after_success:
- coveralls
- bin/build_docs.sh

env:
global:
secure: DMQgAnged8quDKf3pTLG6RZVMKhrhZfYSRKaPFJrERXEOuRPJjC4QYG24pdyCV2aOQbSOiF16vSctpDmMfjLDARkhNm8FvYYCOKLkE+4ijQ4vE/uQaHsnosGS/1LOOFGjK0h2dvm4CNJqV1JUhCKeOVe/87GGY2JVBy+NJnsl70=
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v1.5.4
======

* Support for PyToolz 0.11+

v1.5.3
======

Expand Down
45 changes: 14 additions & 31 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,40 +1,23 @@
Orca
====

.. image:: https://img.shields.io/pypi/v/orca.svg
:target: https://pypi.python.org/pypi/orca/
:alt: PyPI Latest Version

.. image:: https://travis-ci.org/UDST/orca.svg?branch=master
:target: https://travis-ci.org/UDST/orca
:alt: Build Status

.. image:: https://coveralls.io/repos/UDST/orca/badge.svg?branch=master
:target: https://coveralls.io/r/UDST/orca?branch=master
:alt: Coverage

.. image:: https://img.shields.io/pypi/wheel/orca.svg
:target: https://pypi.python.org/pypi/orca/
:alt: Wheel Status
Orca
====

Orca is a Python library for task orchestration. It's designed for workflows like city simulation, where the data representing a model's state is so large that it needs to be managed outside of the task graph.

The building blocks of a workflow are "steps", Python functions that can be assembled on the fly into linear or cyclical pipelines. Steps typically interact with a central data store that persists in memory while the pipeline runs. Derived tables and columns can be updated automatically as base data changes, and pipeline components are evaluated lazily to reduce unnecessary overhead.

Orca is a pipeline orchestration tool that allows you to define dynamic data
sources and explicitly connect them to processing functions.
Orca has many features for working with `Pandas <http://pandas.pydata.org/>`__
data structures, but it can be used with anything.
Orca is used in `UrbanSim <https://github.com/udst/urbansim>`__ and other projects.

Learn more in the official docs at https://udst.github.io/orca/.
Documentation
-------------

Building the Orca UI JS Bundle
------------------------------
- `udst.github.io/orca/ <https://udst.github.io/orca/>`__

Orca ships with a bundle of JavaScript for the server UI.
If you've installed Orca from ``pip`` or ``conda`` you already have the
bundle, but if you're working on Orca you might need to build it manually:
Installation
------------

* Make sure `nodejs <https://nodejs.org/>`__ is installed.
(I use `Homebrew <http://brew.sh/>`__ on my Mac.)
* Install `gulp <http://gulpjs.com/>`__: ``npm install -g gulp``
* Change directories to ``orca/server/static``
* Run ``npm install`` to install dependencies
* Build the bundle: ``gulp js-build``, or
* Watch JS files to rebuild the bundle on changes: ``gulp js-watch``
- ``pip install orca``
- ``conda install orca --channel conda-forge``
31 changes: 31 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
This folder generates the Orca online documentation, hosted at https://udst.github.io/orca/.

### How it works

HTML files are generated using [Sphinx](http://sphinx-doc.org) and hosted with GitHub Pages from the `gh-pages` branch of the repository. The online documentation is rendered and updated **manually**.

### Editing the documentation

The files in `docs/source`, along with docstrings in the source code, determine what appears in the rendered documentation. Here's a [good tutorial](https://pythonhosted.org/an_example_pypi_project/sphinx.html) for Sphinx.

### Previewing changes locally

Install the copy of Orca that the documentation is meant to reflect. Install the documentation tools.

```
pip install .
pip install sphinx sphinx_rtd_theme numpydoc
```

Build the documentation. There should be status messages and warnings, but no errors.

```
cd docs
sphinx-build -b html source build
```

The HTML files will show up in `docs/build/`.

### Uploading changes

Clone a second copy of the repository and check out the `gh-pages` branch. Copy over the updated HTML files, commit them, and push the changes to GitHub.
1 change: 1 addition & 0 deletions docs/build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*/*
File renamed without changes.
6 changes: 3 additions & 3 deletions docs/conf.py → docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@

# General information about the project.
project = 'Orca'
copyright = '2019, UrbanSim Inc'
copyright = '2020, UrbanSim Inc'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '1.5'
version = '1.5.4'
# The full version, including alpha/beta/rc tags.
release = '1.5.3'
release = '1.5.4'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
File renamed without changes.
File renamed without changes.
13 changes: 5 additions & 8 deletions docs/index.rst → docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,16 @@ Orca offers some conveniences for streamlining the construction of pipelines:
Installation
------------

Orca depends on Pandas, PyTables, and toolz (or cytoolz).
Pandas and PyTables are included in `Anaconda <http://docs.continuum.io/anaconda/>`__.
Toolz may be installed with `pip <https://pip.pypa.io/en/latest/index.html>`__,
and both toolz and cytoolz are can be installed by
`conda <http://conda.pydata.org/>`__ (if you are using Anaconda or miniconda).
Orca requires Pandas, PyTables, and PyToolz, which will be installed automatically if they are not already present in your Python environment.

With the dependencies installed, install Orca with pip::

You can install Orca with pip::

pip install orca

Orca may also be installed with conda::
Or with conda::

conda install -c udst orca
conda install orca --channel conda-forge

Add the server option to include the optional server dependencies::

Expand Down
File renamed without changes.
13 changes: 13 additions & 0 deletions docs/server.rst → docs/source/server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ Orca by including the ``[server]`` option::

pip install orca[server]

Building the Orca UI JS Bundle
------------------------------

This is NOT NECESSARY if you've installed Orca from ``pip`` or ``conda``, but these instructions may help if you're working directly with the Orca source code.

* Make sure `nodejs <https://nodejs.org/>`__ is installed.
(`Homebrew <http://brew.sh/>`__ is a nice way to do this on Mac.)
* Install `gulp <http://gulpjs.com/>`__: ``npm install -g gulp``
* Change directories to ``orca/server/static``
* Run ``npm install`` to install dependencies
* Build the bundle: ``gulp js-build``, or
* Watch JS files to rebuild the bundle on changes: ``gulp js-watch``

Start the Server
----------------

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion orca/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

from .orca import *

version = __version__ = '1.5.3'
version = __version__ = '1.5.4'
12 changes: 8 additions & 4 deletions orca/orca.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,21 @@
import logging
import time
import warnings
from collections import Callable, namedtuple
from collections import namedtuple
try:
from collections.abc import Callable
except ImportError: # Python 2.7
from collections import Callable
from contextlib import contextmanager
from functools import wraps


import pandas as pd
import tables
import tlz as tz

from . import utils
from .utils.logutil import log_start_finish
from collections import namedtuple

warnings.filterwarnings('ignore', category=tables.NaturalNameWarning)
logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -937,8 +941,8 @@ def _collect_variables(names, expressions=None):
expressions = []
offset = len(names) - len(expressions)
labels_map = dict(tz.concatv(
tz.compatibility.zip(names[:offset], names[:offset]),
tz.compatibility.zip(names[offset:], expressions)))
zip(names[:offset], names[:offset]),
zip(names[offset:], expressions)))

all_variables = tz.merge(_INJECTABLES, _TABLES)
variables = {}
Expand Down
2 changes: 1 addition & 1 deletion orca/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def column_csv(table_name, col_name):
Return a column as CSV using Pandas' default CSV output.
"""
csv = orca.get_table(table_name).get_column(col_name).to_csv(path=None)
csv = orca.get_table(table_name).get_column(col_name).to_csv(path_or_buf=None)
return csv, 200, {'Content-Type': 'text/csv'}


Expand Down
7 changes: 4 additions & 3 deletions orca/server/tests/test_server.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import json

import orca
import numpy as np
import pandas as pd
import pandas.util.testing as pdt
import pandas.testing as pdt
import pytest

from .. import server
Expand Down Expand Up @@ -233,7 +234,7 @@ def test_column_csv(tapp, dfa):
assert rv.status_code == 200

data = rv.data.decode('utf-8')
assert data == dfa.a.to_csv(path=None)
assert data == dfa.a.to_csv(path_or_buf=None)


def test_no_column_404(tapp):
Expand Down Expand Up @@ -420,5 +421,5 @@ def test_table_groupbyagg_level_std(tapp):
pdt.assert_series_equal(
test,
pd.Series(
[pd.np.nan, pd.Series([80, 90]).std()],
[np.nan, pd.Series([80, 90]).std()],
index=['a', 'b'], name='b'))
2 changes: 1 addition & 1 deletion orca/tests/test_orca.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import tempfile

import pandas as pd
import pandas.testing as pdt
import pytest
from pandas.util import testing as pdt

from .. import orca
from ..utils.testing import assert_frames_equal
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def run(self):

setup(
name='orca',
version='1.5.3',
version='1.5.4',
description='A pipeline orchestration tool with Pandas support',
long_description=long_description,
author='UrbanSim Inc.',
Expand All @@ -52,6 +52,7 @@ def run(self):
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'License :: OSI Approved :: BSD License'
],
packages=find_packages(exclude=['*.tests']),
Expand Down

0 comments on commit 0a41626

Please sign in to comment.