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

Feature/pylace removable rows #195

Merged
merged 6 commits into from
May 3, 2024
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
20 changes: 13 additions & 7 deletions .github/scripts/find_compatible_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,29 @@
description="Program to find wheels in a directory compatible with the current version of Python"
)

parser.add_argument("package", help="The name of the package that you are searching for a wheel for")
parser.add_argument(
"package", help="The name of the package that you are searching for a wheel for"
)
parser.add_argument("dir", help="the directory under which to search for the wheels")

args=parser.parse_args()
args = parser.parse_args()

wheel=None
wheel = None

for tag in sys_tags():
print(f"Looking for file matching tag {tag}", file=sys.stderr)
matches=glob.glob(args.package + "*" + str(tag) + "*.whl", root_dir=args.dir)
matches = glob.glob(f"{args.package}*{tag}*.whl", root_dir=args.dir)
if len(matches) == 1:
wheel=matches[0]
wheel = matches[0]
break
elif len(matches) > 1:
print("Found multiple matches for the same tag " + str(tag), matches, file=sys.stderr)
print(
f"Found multiple matches for the same tag `{tag}`",
matches,
file=sys.stderr,
)

if wheel:
if wheel:
print(os.path.join(args.dir, wheel))
else:
sys.exit("Did not find compatible wheel")
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- uses: actions/checkout@v4

- run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install nbbrd/tap/heylogs
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/python-build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
defaults:
run:
working-directory: pylace

steps:
- uses: actions/checkout@v4

Expand All @@ -30,7 +30,7 @@ jobs:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: "pylace/requirements-lint.txt"

- name: Install Python dependencies
run: |
pip install --upgrade pip
Expand Down Expand Up @@ -102,18 +102,18 @@ jobs:
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
maturin-version: 1.5.1
target: ${{ matrix.target }}
args: --release --out dist -i python3.8 -i python3.9 -i python3.10 -i python3.11 -i python3.12 --manifest-path pylace/Cargo.toml
manylinux: auto

- name: Install dev dependencies
run: |
pip install --upgrade pip
pip install -r pylace/requirements-dev.txt

- name: Install pylace
run: |
ls -l ./dist
WHEEL_FILE=$(python3 .github/scripts/find_compatible_wheel.py pylace ./dist)
echo "Installing $WHEEL_FILE"
pip install $WHEEL_FILE
Expand Down Expand Up @@ -147,17 +147,17 @@ jobs:
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
maturin-version: 1.5.1
target: ${{ matrix.target }}
args: --release --out dist -i python3.8 -i python3.9 -i python3.10 -i python3.11 -i python3.12 --manifest-path pylace/Cargo.toml

- name: Install dev dependencies
run: |
pip install --upgrade pip
pip install -r pylace/requirements-dev.txt

- name: Install pylace
run: |
ls -l ./dist
$WHEEL_FILE = (python3 .github/scripts/find_compatible_wheel.py pylace ./dist)
echo "Installing $WHEEL_FILE"
pip install $WHEEL_FILE
Expand All @@ -172,11 +172,15 @@ jobs:
path: dist

macos:
runs-on: macos-latest
needs: ["lint-python", "lint-rust"]
strategy:
matrix:
target: [x86_64, aarch64]
include:
- os: macos-latest
target: aarch64
- os: macos-13
target: x86_64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -190,24 +194,22 @@ jobs:
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
maturin-version: 1.5.1
target: ${{ matrix.target }}
args: --release --out dist -i python3.8 -i python3.9 -i python3.10 -i python3.11 -i python3.12 --manifest-path pylace/Cargo.toml

- name: Install dev dependencies
if: ${{ matrix.target != 'aarch64' }}
run: |
pip install --upgrade pip
pip install -r pylace/requirements-dev.txt

- name: Install pylace
if: ${{ matrix.target != 'aarch64' }}
run: |
WHEEL_FILE=$(python3 .github/scripts/find_compatible_wheel.py pylace ./dist)
echo "Installing $WHEEL_FILE"
pip install $WHEEL_FILE

- name: Run Tests
if: ${{ matrix.target != 'aarch64' }}
run: pytest pylace/tests

- name: Upload wheels
Expand Down
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Changed `SerializedType` default to `Bincode`
- moved `Assignment` from `lace_cc` to `lace_stats`

## [python-0.8.0] 2024-04-10
## [python-0.8.0] - 2024-04-10

### Added

- Added ability Pitman-Yor prior process
- Added ability Pitman-Yor prior process.
- Added `remove_rows` to `Engine`.
- Added `with_index` to `CodeBook`.

### Changed

- `StateAlpha` and `ViewAlpha` transitions are now `StatePriorProcessParams` and `ViewPriorProcessParams`
- Updated Pyo3 version to 0.21

## [python-0.7.1] - 2024-02-27

Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ keywords:
- Bayesian
- Machine Learning
license: BUSL-1.1
version: 0.7.0
version: 0.8.0
date-released: '2024-02-07'
4 changes: 2 additions & 2 deletions book/lace_preprocess_mdbook_yaml/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ path = "src/main.rs"
anyhow = "1.0"
clap = "4.2"
env_logger = "0.10"
lace_codebook = { path = "../../lace/lace_codebook", version = "0.6.0" }
lace_stats = { path = "../../lace/lace_stats", version = "0.3.0" }
lace_codebook = { path = "../../lace/lace_codebook", version = "0.7.0" }
lace_stats = { path = "../../lace/lace_stats", version = "0.4.0" }
log = "0.4"
mdbook = "0.4"
pulldown-cmark = { version = "0.9", default-features = false }
Expand Down
Loading
Loading