Skip to content

Commit

Permalink
Merge pull request #24 from chrishavlin/use_pyproject
Browse files Browse the repository at this point in the history
Use pyproject
  • Loading branch information
chrishavlin committed Jul 26, 2023
2 parents fd103eb + 0e1efcb commit 9d9d048
Show file tree
Hide file tree
Showing 13 changed files with 89 additions and 100 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ jobs:
sudo apt-get install libopenblas-dev
python -m pip install --upgrade pip
python -m pip install scipy==1.8.0
python -m pip install -r requirements_dev.txt
- name: Setup pyVBRc
run: |
python -m pip install -e .
python -m pip install -e .[dev]
- name: Run Tests
run: pytest --cov=./ --cov-report=xml:coverage/coverage.xml -v pyVBRc/
# https://github.com/marketplace/actions/codecov#example-workflowyml-with-codecov-action
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/check-build.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: Check Build
name: Build Verification
on: pull_request

jobs:
twinecheck:
name: twinecheck
build-and-check:
name: Build Verification
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -U setuptools setuptools_scm wheel twine
- name: Build and check
run: |
python setup.py sdist bdist_wheel
twine check dist/*
python -m pip install --upgrade pip
python -m pip install -U build twine
- name: Build and check source tarball
run: python -m build
- name: Twine check
run: twine check dist/*
2 changes: 1 addition & 1 deletion .github/workflows/check-manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: install build dependencies
run: |
python -m pip install wheel
- name: Install yt_xarray
- name: Install pyVBRc
shell: bash
run: |
python -m pip install --no-build-isolation .
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/pypi-release.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
name: Publish distributions to PyPI

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Publish distributions to PyPI

jobs:
build-and-publish:
name: Build and Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v1
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -U setuptools setuptools_scm wheel twine
python -m pip install -U build twine
- name: Build and check source tarball
run: python setup.py sdist bdist_wheel
run: python -m build
- name: Twine check
run: twine check dist/*
- name: Publish distribution to PyPI
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ include *.txt
include Makefile

recursive-include * *.m
recursive-include pyVBRc *.mat
recursive-include pyVBRc *.py
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
recursive-exclude * *.mat
recursive-exclude examples *.mat
recursive-exclude examples *.png
include examples *.ipynb
Expand Down
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,25 @@

pyVBRc is a python package for working with output from the [Very Broadband Rheology Calculator](https://github.com/vbr-calc/vbr). pyVBRc is currently (very) experimental and is likely to change drastically between early versions, but feel free to use it.

## installation
## Installation

To install the latest release:

```
pip install pyVBRc
```

To install the latest development version, fork and clone this repository then run
To install the latest development version, see the section on
[Contributing](#contributing).

```
pip install .
```

## usage
## Usage

As of now, you can use `pyVBRc` to:

* load a VBR structure
* interpolate between calculated values in the VBR structure

### loading a VBR structure
### Loading a VBR structure

The primary gateway into working with VBRc data in the `VBRstruct`. Note that the following examples rely on a tiny VBR output file, `VBRc_sample_LUT.mat`, included in pyVBRc to allow simple testing of functionality. For any real application, you should generate your own VBR structure (in MATLAB or Octave).

Expand Down Expand Up @@ -53,7 +50,7 @@ plt.show()

![](https://raw.githubusercontent.com/vbr-calc/pyVBRc/main/examples/andrade_psp_T_dep.png)

## interpolating
### Interpolating

In some situations, it may be useful to interpolate VBRc results at arbitrary points between calculated points. The sample file,`"VBRc_sample_LUT.mat"` was calculated for a very coarse grid of temperature (`T_K`), melt fraction (`phi`) and grain size(`dg_um`) at two frequencies to serve as a simple look-up table (LUT). You can provide these variable names to the `lut_dimensions` keyword argument when initializing the `VBRCstruct`:

Expand Down Expand Up @@ -115,7 +112,7 @@ which yields

**NOTE** that the validity of any interpolation will depend on the underlying VBR structure that you have built.

## Additional examples
### Additional examples

For now, check out the [examples directory](https://github.com/vbr-calc/pyVBRc/tree/main/examples) for more examples.

Expand All @@ -127,14 +124,25 @@ If you have questions, feel free to ask in the VBRc slack channel (see [here](ht

## Contributing

Contributions fall a fork-pull request open source work flow.
Contributions fall a fork-pull request open source work flow:

1. Fork this repository
2. Clone your fork and build a development installation (see below)
3. Create a new branch (`git checkout -b your_new_branch_name`)
4. Commit changes on your branch
5. Push your branch to your fork
6. Submit pull request (PR) to the main `pyVBRc` repository

After PR submission, a number of automated tests will run and your changes
will be reviewed. Often this may involve some iteration, but we'll help you out
if you're new to git!

### Development installation

After cloning your fork, you can install `pyVBRc` with

```shell
pip install -e .
pip install -e .[dev]
```

and then install all the development requirements with
Expand Down
41 changes: 41 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "pyVBRc"
version = "0.1.1"
authors = [
{ name="Chris Havlin", email="[email protected]" },
]
description="python utilities for working with the VBRc"
readme = "README.md"
requires-python = ">=3.9"
classifiers=[
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
dependencies=["numpy",
"scipy",
"matplotlib",
"packaging",
"unyt",
]

[tool.setuptools]
packages = ["pyVBRc"]

[project.urls]
"Homepage" = "https://github.com/vbr-calc/pyVBRc"
"Bug Tracker" = "https://github.com/vbr-calc/pyVBRc/issues"

[project.optional-dependencies]
dev = [
"pytest>=3",
"pytest-cov",
"pre-commit",
]
6 changes: 6 additions & 0 deletions release_history.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v0.1.2

maintenance release
* full switch to pyproject
* docs improvements

# v0.1.1

Initial release of pyVBRc, still experimental
Expand Down
5 changes: 0 additions & 5 deletions requirements.txt

This file was deleted.

5 changes: 0 additions & 5 deletions requirements_dev.txt

This file was deleted.

4 changes: 0 additions & 4 deletions requirements_style.txt

This file was deleted.

3 changes: 0 additions & 3 deletions setup.cfg

This file was deleted.

49 changes: 0 additions & 49 deletions setup.py

This file was deleted.

0 comments on commit 9d9d048

Please sign in to comment.