- Temporal
- time dimension. A property can have spatial and/or temporal dimensions, e.g. what it was and when it was that.
- Bi-temporal
- 2x time dimensions. Allows you to separate the "valid time" of a property from "when we knew about it"
- Version Clock
- a simple, incrementing integer that allows you track "generation" of changes (also known as "vclock")
- Version
- the state of an entity at a given version clock
- Low Velocity
- state changes infrequently or you don't need to walk the history regularly
- High Velocity
- state changes frequently or you need to walk the history regularly.
There exist several ways to add a temporal dimension to your data.
SQLAlchemy Continuum uses a shadow or history table for each versioned
entity. You can add a date_created
and date_modified
columns to your model.
Temporal SQLAlchemy uses a table per property, with an entity clock -- all state is written to the entity table as expected, but additionally recorded into series of history tables (per property) and clock entries (per entity).
This package uses Tox to run tests on multiple versions of Python.
To set up your development environment, you'll need to install a few things. For Python version management, we use pyenv-virtualenv. Follow the installation instructions there, and then in the root directory of this repo run:
# Install all the Python versions this package supports. This will take some
# time.
pyenv install 3.4.6
pyenv install 3.5.3
pyenv install 3.6.3
pyenv local 3.6.3 3.5.3 3.4.6
# Install the development dependencies
pip3 install -Ur dev-requirements.txt
To run the unit tests for all supported versions of Python, run tox
. If you
made a change to the package requirements (in setup.py
or test_requirements.txt
)
then you'll need to rebuild the environment. Use tox -r
to rebuild them and
run the tests.
Once development is done, as your last commit on the branch you'll want to
change the version number and create a tag for deployment. Please do this via
the bumpversion
command. More information on bumpversion
and its usage
can be found here, but in most
cases you'll run one of the following commands. Assuming the current version is
1.2.3:
# Change the version to 1.2.4
bumpversion patch
# Change the version to 1.3.0
bumpversion minor
# Change the version to 2.0.0
bumpversion major