Skip to content

Commit

Permalink
Merge pull request #62 from UDST/revert-55-travis-setup
Browse files Browse the repository at this point in the history
Revert "[0.1.dev18] Installation improvements and continuous integration"
  • Loading branch information
smmaurer authored Nov 19, 2018
2 parents 11abed3 + d85d0cf commit 71049ca
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 100 deletions.
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

25 changes: 3 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[![Build Status](https://travis-ci.org/UDST/urbansim_templates.svg?branch=master)](https://travis-ci.org/UDST/urbansim_templates)
[![Coverage Status](https://coveralls.io/repos/github/UDST/urbansim_templates/badge.svg?branch=master)](https://coveralls.io/github/UDST/urbansim_templates?branch=master)

# UrbanSim Templates

UrbanSim Templates defines a common structure for new model steps and provides a core set of flexible templates and related tools. The goal is to enable smoother model setup, easier code reuse, and improvements to task orchestration.
Expand All @@ -12,31 +9,17 @@ UrbanSim Templates is currently in pre-release. API documentation is in the Pyth

## Installation

It can be helpful to set up a dedicated Python environment for working on UrbanSim projects, for reproducibility and to avoid conflicts with other projects. MORE INFO TK.

### Production releases

Coming soon to pip and conda.
You can follow the setup instructions in [UAL/urbansim_parcel_bayarea](https://github.com/ual/urbansim_parcel_bayarea) to create a conda environment with everything you need for working in the UrbanSim Templates ecosystem.

### Development releases

The latest development release can be installed using the Github URL. These currently require having a development release of ChoiceModels as well, which you should install first.

```
pip install git+git://github.com/udst/choicemodels.git
pip install git+git://github.com/udst/urbansim_templates.git
```

### Cloning the repository

If you will be editing the library code or frequently updating to newer development versions, you can clone the repository and link it to your Python environment:
If you already have most of it installed, this should be sufficient:

```
git clone https://github.com/udst/urbansim_templates.git
cd urbansim_templates
python setup.py develop
```


## Bug reports

Open an issue, or contact Sam ([email protected]).
Expand Down Expand Up @@ -121,5 +104,3 @@ ModelManager works directly with the current versions of [UrbanSim](https://gith
- Shared template functionality is in `utils.py`. There's also a `TemplateStep` parent class in `shared.py`, but this hasn't worked very well; see [issue #38](https://github.com/UDST/urbansim_templates/issues/38).

- We don't have design patterns yet for templates whose final output is to _generate_ DataFrames or Series, rather than modifying existing ones, but we're working on it.

- To avoid dependency bloat, the default installation only includes the external libraries required for core model management and the most commonly used templates. Templates using additional libraries should check whether they're installed before fitting or running a model step, and provide helpful error messages if not.
5 changes: 0 additions & 5 deletions requirements-dev.txt

This file was deleted.

3 changes: 0 additions & 3 deletions requirements-full.txt

This file was deleted.

9 changes: 0 additions & 9 deletions requirements.txt

This file was deleted.

16 changes: 9 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
from setuptools import setup, find_packages

with open('requirements.txt') as f:
requirements = f.readlines()
requirements = [item.strip() for item in requirements]

setup(
name='urbansim_templates',
version='0.1.dev17',
Expand All @@ -17,8 +13,14 @@
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'License :: OSI Approved :: BSD License'
],
packages=find_packages(exclude=['*.tests']),
install_requires=requirements
)
install_requires=[
'numpy >= 1.14',
'orca >= 1.4',
'pandana >= 0.3',
'pandas >= 0.22',
'statsmodels >= 0.8',
'urbansim >= 3.1.1'
]
)
2 changes: 1 addition & 1 deletion urbansim_templates/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = __version__ = '0.1.dev17'
version = __version__ = '0.1.dev17'
29 changes: 8 additions & 21 deletions urbansim_templates/models/large_multinomial_logit.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
from __future__ import print_function

import numpy as np
import pandas as pd
import patsy

import orca
# choicemodels imports are in the fit() and run() methods
from choicemodels import mnl
from choicemodels import MultinomialLogit, MultinomialLogitResults
from choicemodels.tools import (MergedChoiceTable, monte_carlo_choices,
iterative_lottery_choices)

from .. import modelmanager
from ..utils import version_greater_or_equal
from .shared import TemplateStep


Expand Down Expand Up @@ -406,15 +412,6 @@ def fit(self, mct=None):
None
"""
try:
from choicemodels import __version__, MultinomialLogit
from choicemodels.tools import MergedChoiceTable
assert version_greater_or_equal(__version__, '0.2.dev4')
except:
raise ImportError("LargeMultinomialLogitStep estimation requires "
"choicemodels 0.2.dev4 or later. For installation instructions, see "
"https://github.com/udst/choicemodels.")

if (mct is not None):
data = mct

Expand Down Expand Up @@ -479,16 +476,6 @@ def run(self, chooser_batch_size=None, interaction_terms=None):
None
"""
try:
from choicemodels import __version__, MultinomialLogitResults
from choicemodels.tools import (MergedChoiceTable, monte_carlo_choices,
iterative_lottery_choices)
assert version_greater_or_equal(__version__, '0.2.dev4')
except:
raise ImportError("LargeMultinomialLogitStep simulation requires "
"choicemodels 0.2.dev4 or later. For installation instructions, see "
"https://github.com/udst/choicemodels.")

obs = self._get_df(tables=self.out_choosers, fallback_tables=self.choosers,
filters=self.out_chooser_filters)

Expand Down
1 change: 0 additions & 1 deletion urbansim_templates/tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
.coverage
__pycache__/*

0 comments on commit 71049ca

Please sign in to comment.