Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CI

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
tests:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
# Lower support boundary: oldest Python plus the minimum
# supported versions of the core dependencies
- name: Python 3.10 + minimum deps
python-version: "3.10"
pip-args: -c requirements-min.txt
# Forward boundary: newest supported Python plus current
# versions of all dependencies
- name: Python 3.14 + latest deps
python-version: "3.14"
pip-args: ""

steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
pyproject.toml
requirements-min.txt

- name: Install package and test dependencies
run: python -m pip install ".[test]" ${{ matrix.pip-args }}

- name: Run tests
run: python -m pytest --cov

quality:
name: Code quality
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: "3.14"
cache: pip
cache-dependency-path: pyproject.toml

- name: Install ruff
run: python -m pip install ruff

- name: Check source
run: ruff check orca
21 changes: 0 additions & 21 deletions .github/workflows/code-style.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/coverage.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/cross-compatibility.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/installation.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/unit-tests.yml

This file was deleted.

12 changes: 12 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
Next release
============

* Require Python 3.10 or newer.
* Support pandas 2 and 3, NumPy 2, and current PyTables, with minimum
versions of pandas 1.5, NumPy 1.21, PyTables 3.8, and PyToolz 0.12.
* Behavior change under pandas 3: with ``copy_col=False``, pandas's
mandatory copy-on-write means that modifying a column returned from a
table no longer writes through to the table's underlying DataFrame.
Use ``update_col`` or ``update_col_from_series`` to change table values.
* Modernize Python packaging and continuous integration.

v1.8
====

Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include HISTORY.rst
include LICENSE.txt
include README.rst
recursive-include orca/tests *.py
recursive-include orca/utils/tests *.py
4 changes: 3 additions & 1 deletion orca/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
__version__ = "1.9.dev0"

from .orca import *

version = __version__ = '1.8'
version = __version__
36 changes: 18 additions & 18 deletions orca/orca.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,14 @@
# Copyright (C) 2022 UrbanSim Inc.
# See full license in LICENSE.

from __future__ import print_function

try:
from inspect import getfullargspec as getargspec
except ImportError:
from inspect import getargspec
import logging
import time
import warnings
from collections import namedtuple
try:
from collections.abc import Callable
except ImportError: # Python 2.7
from collections import Callable
from collections.abc import Callable
from contextlib import contextmanager
from functools import wraps
from inspect import getfullargspec


import pandas as pd
Expand Down Expand Up @@ -191,7 +183,6 @@ def _update_scope(wrapper, new_scope=None):
raise ValueError(msg)

# update the cache properties
curr_cache = wrapper.cache
curr_scope = wrapper.cache_scope
if new_scope is None:
# set to defaults, i.e. no caching
Expand Down Expand Up @@ -328,7 +319,10 @@ class DataFrameWrapper(object):
Name for the table.
frame : pandas.DataFrame
copy_col : bool, optional
Whether to return copies when evaluating columns.
Whether to return copies when evaluating columns. When False,
returned columns share memory with the underlying DataFrame;
note that under pandas 3's copy-on-write behavior, modifying
such a column no longer writes through to the table.

Attributes
----------
Expand Down Expand Up @@ -558,7 +552,10 @@ class TableFuncWrapper(object):
complete iteration of the pipeline, 'step' caches data for
a single step of the pipeline.
copy_col : bool, optional
Whether to return copies when evaluating columns.
Whether to return copies when evaluating columns. When False,
returned columns share memory with the underlying DataFrame;
note that under pandas 3's copy-on-write behavior, modifying
such a column no longer writes through to the table.

Attributes
----------
Expand All @@ -575,7 +572,7 @@ def __init__(
copy_col=True):
self.name = name
self._func = func
self._argspec = getargspec(func)
self._argspec = getfullargspec(func)
self.cache = cache
self.cache_scope = cache_scope
self.copy_col = copy_col
Expand Down Expand Up @@ -790,7 +787,7 @@ def __init__(
self.table_name = table_name
self.name = column_name
self._func = func
self._argspec = getargspec(func)
self._argspec = getfullargspec(func)
self.cache = cache
self.cache_scope = cache_scope

Expand Down Expand Up @@ -912,7 +909,7 @@ class _InjectableFuncWrapper(object):
def __init__(self, name, func, cache=False, cache_scope=_CS_FOREVER):
self.name = name
self._func = func
self._argspec = getargspec(func)
self._argspec = getfullargspec(func)
self.cache = cache
self.cache_scope = cache_scope

Expand Down Expand Up @@ -964,7 +961,7 @@ class _StepFuncWrapper(object):
def __init__(self, step_name, func):
self.name = step_name
self._func = func
self._argspec = getargspec(func)
self._argspec = getfullargspec(func)

def __call__(self):
with log_start_finish('calling step {!r}'.format(self.name), logger):
Expand Down Expand Up @@ -1162,7 +1159,10 @@ def add_table(
complete iteration of the pipeline, 'step' caches data for
a single step of the pipeline.
copy_col : bool, optional
Whether to return copies when evaluating columns.
Whether to return copies when evaluating columns. When False,
returned columns share memory with the underlying DataFrame;
note that under pandas 3's copy-on-write behavior, modifying
such a column no longer writes through to the table.

Returns
-------
Expand Down
Loading