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

Make a package #1

Merged
merged 35 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
76ffa56
Clean up and speed up simulatior
prisae Mar 15, 2024
b1602bc
Remove lasts loop; nx==ny atm
prisae Mar 15, 2024
2e4627d
some comments for next steps
prisae Mar 15, 2024
d989ad4
Change shape
prisae Mar 18, 2024
d5288f4
Add test-nb for nx!=ny
prisae Mar 18, 2024
3b91a87
Add arb. wells
prisae Mar 19, 2024
b4dc1c9
Fix nx!=ny; some comments
prisae Mar 22, 2024
29b0e76
Started with ESMDA; speedup cov-matrix
prisae Apr 5, 2024
32d70e2
Fix dx=dy
prisae Apr 9, 2024
a2b4789
Improved cov matrix
prisae Apr 12, 2024
88ca1ee
Work on Ne perm fields
prisae Apr 15, 2024
58e321c
Notebook/ESMDA working
prisae Apr 16, 2024
6fe570c
Start sparse cov dev
prisae Apr 17, 2024
54dccc8
Move cov to sparse
prisae Apr 18, 2024
a40152d
Added sparse cov to notebook
prisae Apr 18, 2024
2858e07
RP-class; RS-call can return x real
prisae Apr 19, 2024
7b71dff
fold plotting code
prisae Apr 19, 2024
9db6a3a
Add back Gaspari Cohn
prisae Apr 22, 2024
9f7f3e7
Moved esmda to rs
prisae May 6, 2024
39379d3
Annotate
prisae May 7, 2024
9701aff
Cleaning and documenting esmda routine
prisae May 13, 2024
1f4176d
Note re factor ne-1
prisae May 13, 2024
5be7a0c
move vmin/vmax to callback fct
prisae May 14, 2024
dc5e41d
Radical restructuring to create package
prisae May 14, 2024
6f69f92
setup files
prisae May 14, 2024
56042dd
Add scooby and version info
prisae May 14, 2024
faf9996
Add CI workflow
prisae May 22, 2024
900b5f9
Docs
prisae May 24, 2024
46d785b
Docs II
prisae May 24, 2024
7573f9f
Docs III
prisae May 24, 2024
06ceca2
Docs IV
prisae May 24, 2024
c46d0b1
Docs V
prisae May 24, 2024
cae9eaf
Push it
prisae May 24, 2024
ae3f283
Add a test
prisae May 24, 2024
867a7cb
Adjust GHA
prisae May 24, 2024
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
47 changes: 47 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: documentation

on:
pull_request:
push:
branches:
- main
release:
types:
- published

permissions:
contents: write

jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 100
persist-credentials: false

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install dependencies
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt

- name: Create docs
shell: bash -l {0}
run: make html

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html/
force_orphan: true
142 changes: 142 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: linux

# Only build PRs, the main branch, and releases.
on:
pull_request:
push:
branches:
- main
release:
types:
- published
schedule:
- cron: "14 14 20 * *"

# Use bash by default in all jobs
defaults:
run:
# Using "-l {0}" is necessary for conda environments to be activated
# But this breaks on MacOS if using actions/setup-python:
# https://github.com/actions/setup-python/issues/132
shell: bash

# Cancel any previous run of the test job.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:

name: basic
runs-on: ubuntu-latest

steps:

# Checks-out your repository under $GITHUB_WORKSPACE
- name: Checkout
uses: actions/checkout@v4
with:
# Need to fetch more than the last commit so that setuptools-scm can
# create the correct version string. If the number of commits since
# the last release is greater than this, the version still be wrong.
# Increase if necessary.
fetch-depth: 100
# The GitHub token is preserved by default but this job doesn't need
# to be able to push to GitHub.
persist-credentials: false

# Need the tags so that setuptools-scm can form a valid version number
- name: Fetch git tags
run: git fetch origin 'refs/tags/*:refs/tags/*'

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install dependencies
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt

- name: Flake8
shell: bash -l {0}
run: flake8 docs/conf.py setup.py resmda/ tests/

- name: Test with pytest
shell: bash -l {0}
run: |
python -m pip install .
pytest --cov=resmda

deploy:
needs: test
name: Deploy to PyPI
runs-on: ubuntu-latest
# Only from the origin repository, not forks; only main and tags.
if: github.repository_owner == 'tuda' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))

steps:
# Checks-out your repository under $GITHUB_WORKSPACE
- name: Checkout
uses: actions/checkout@v4
with:
# Need to fetch more than the last commit so that setuptools-scm can
# create the correct version string. If the number of commits since
# the last release is greater than this, the version will still be
# wrong. Increase if necessary.
fetch-depth: 100
# The GitHub token is preserved by default but this job doesn't need
# to be able to push to GitHub.
persist-credentials: false

# Need the tags so that setuptools-scm can form a valid version number
- name: Fetch git tags
run: git fetch origin 'refs/tags/*:refs/tags/*'

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build setuptools-scm

- name: Build source and wheel distributions
if: github.ref == 'refs/heads/main'
run: |
# Change setuptools-scm local_scheme to "no-local-version" so the
# local part of the version isn't included, making the version string
# compatible with Test PyPI.
sed --in-place 's/"root"/"local_scheme":"no-local-version","root"/g' setup.py

- name: Build source and wheel distributions
run: |
# Build source and wheel packages
python -m build
echo ""
echo "Generated files:"
ls -lh dist/

- name: Publish to Test PyPI
if: success()
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_PASSWORD }}
repository_url: https://test.pypi.org/legacy/
# Allow existing releases on test PyPI without errors.
# NOT TO BE USED in PyPI!
skip_existing: true

- name: Publish to PyPI
# Only for releases
if: success() && github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
114 changes: 16 additions & 98 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,104 +1,22 @@
# Byte-compiled / optimized / DLL files
# Directories and file types
__pycache__/
*.py[cod]

# C and Fortran extensions
*.so
*.dylib
*.dll
*.slo
*.lo
*.o
*.obj
*.mod
*.smod
*.lai
*.la
*.a
*.lib
*.exe
*.out
*.app

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
# Sphinx
docs/_build/
docs/api/resmda*
docs/savefig/
docs/gallery/*

# PyBuilder
target/

# DotEnv configuration
.env

# Database
*.db
*.rdb

# Pycharm
.idea

# TeX/LaTeX
*.aux
*.bbl
*.blg
*.synctex.gz
*.xwm

# IPython NB Checkpoints
.ipynb_checkpoints/

# exclude compiled binaries
bin/
# Pytest and coverage related
htmlcov
.coverage
.pytest_cache/

# exclude data from source control by default
/data/external
/data/interim
/data/processed
/data/raw
# setuptools_scm
resmda/version.py

# exclude external models from source control
/src/external/
# Build related
.eggs/
build/
dist/
resmda.egg-info/
12 changes: 0 additions & 12 deletions AUTHORS.md

This file was deleted.

Loading