Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into bootstrap_weights
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlujan91 committed Oct 11, 2024
2 parents b33835d + 216b41e commit 16c59f7
Show file tree
Hide file tree
Showing 447 changed files with 29,943 additions and 26,279 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/enhancement.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ assignees: ''

---

* estimagic version used, if any:
* optimagic version used, if any:
* Python version, if any:
* Operating System:

Expand Down
56 changes: 37 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
os:
- ubuntu-latest
python-version:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
Expand All @@ -30,14 +29,14 @@ jobs:
- name: create build environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./.envs/testenv-linux.yml
environment-file: ./.tools/envs/testenv-linux.yml
cache-environment: true
create-args: |
python=${{ matrix.python-version }}
- name: run pytest
shell: bash -l {0}
run: |
micromamba activate estimagic
micromamba activate optimagic
pytest --cov-report=xml --cov=./
- name: Upload coverage report.
if: runner.os == 'Linux' && matrix.python-version == '3.10'
Expand All @@ -54,27 +53,26 @@ jobs:
- macos-latest
- windows-latest
python-version:
- '3.9'
- '3.10'
- '3.11'
steps:
- uses: actions/checkout@v4
- name: create build environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./.envs/testenv-others.yml
environment-file: ./.tools/envs/testenv-others.yml
cache-environment: true
create-args: |
python=${{ matrix.python-version }}
- name: run pytest
shell: bash -l {0}
run: |
micromamba activate estimagic
micromamba activate optimagic
pytest -m "not slow and not jax"
run-tests-with-old-pandas:
# This job is only for testing if estimagic works with older pandas versions, as
# many pandas functions we use will be deprecated in pandas 3. estimagic's behavior
# for older verions is handled in src/estimagic/compat.py.
# This job is only for testing if optimagic works with older pandas versions, as
# many pandas functions we use will be deprecated in pandas 3. optimagic's behavior
# for older verions is handled in src/optimagic/compat.py.
name: Run tests for ${{ matrix.os}} on ${{ matrix.python-version }} with pandas 1
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -83,23 +81,21 @@ jobs:
os:
- ubuntu-latest
python-version:
- '3.11'
- '3.10'
steps:
- uses: actions/checkout@v4
- name: create build environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./.envs/testenv-pandas.yml
environment-file: ./.tools/envs/testenv-pandas.yml
cache-environment: true
create-args: |
python=${{ matrix.python-version }}
- name: run pytest
shell: bash -l {0}
run: |
micromamba activate estimagic
pytest tests/visualization
pytest tests/parameters
pytest tests/inference
micromamba activate optimagic
pytest -m "not slow and not jax"
code-in-docs:
name: Run code snippets in documentation
runs-on: ubuntu-latest
Expand All @@ -108,12 +104,34 @@ jobs:
- name: create build environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./.envs/testenv-linux.yml
environment-file: ./.tools/envs/testenv-linux.yml
environment-name: optimagic
cache-environment: true
create-args: python=3.10
create-args: |
python=3.12
- name: run sphinx
shell: bash -l {0}
run: |-
micromamba activate estimagic
micromamba activate optimagic
cd docs/source
python -m doctest -v how_to_guides/optimization/how_to_specify_constraints.md
python -m doctest -v how_to/how_to_constraints.md
run-mypy:
name: Run mypy
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: create build environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ./.tools/envs/testenv-linux.yml
environment-name: optimagic
cache-environment: true
create-args: |
python=3.10
- name: Run mypy
shell: bash -l {0}
run: |-
micromamba activate optimagic
mypy
4 changes: 2 additions & 2 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: PyPI
on: push
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
name: Build and publish optimagic Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -28,4 +28,4 @@ jobs:
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
password: ${{ secrets.PYPI_API_TOKEN_OPTIMAGIC }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,6 @@ venv.bak/


src/estimagic/_version.py
src/optimagic/_version.py

*.~lock.*
83 changes: 47 additions & 36 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ repos:
- id: check-useless-excludes
# - id: identity # Prints all files passed to pre-commits. Debugging.
- repo: https://github.com/lyz-code/yamlfix
rev: 1.16.0
rev: 1.17.0
hooks:
- id: yamlfix
exclude: tests/optimization/fixtures
exclude: tests/optimagic/optimizers/_pounders/fixtures
- repo: local
hooks:
- id: update-environment-files
name: check environment file updates
entry: python .envs/update_envs.py
entry: python .tools/update_envs.py
language: python
always_run: true
require_serial: true
Expand All @@ -24,7 +24,7 @@ repos:
- id: check-added-large-files
args:
- --maxkb=1300
exclude: tests/optimization/fixtures/
exclude: tests/optimagic/optimizers/_pounders/fixtures/
- id: check-case-conflict
- id: check-merge-conflict
- id: check-vcs-permalinks
Expand All @@ -48,24 +48,13 @@ repos:
- --branch
- main
- id: trailing-whitespace
exclude: docs/
- id: check-ast
- id: check-docstring-first
exclude: src/estimagic/optimization/algo_options.py
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1
hooks:
- id: yamllint
exclude: tests/optimization/fixtures
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
language_version: python3.10
- repo: https://github.com/asottile/blacken-docs
rev: 1.18.0
hooks:
- id: blacken-docs
exclude: docs/source/how_to_guides/optimization/how_to_specify_constraints.md
exclude: tests/optimagic/optimizers/_pounders/fixtures
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
hooks:
Expand All @@ -77,23 +66,32 @@ repos:
- --wrap-descriptions
- '88'
- --blank
exclude: src/estimagic/optimization/algo_options.py
exclude: src/optimagic/optimization/algo_options.py
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
rev: v0.6.3
hooks:
# Run the linter.
- id: ruff
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.8.5
hooks:
- id: nbqa-black
- id: nbqa-ruff
types_or:
- python
- pyi
- jupyter
args:
- --fix
# Run the formatter.
- id: ruff-format
types_or:
- python
- pyi
- jupyter
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
- id: mdformat
additional_dependencies:
- mdformat-gfm
- mdformat-black
- mdformat-gfm-alerts
- mdformat-ruff
args:
- --wrap
- '88'
Expand All @@ -104,23 +102,36 @@ repos:
- id: mdformat
additional_dependencies:
- mdformat-myst
- mdformat-black
- mdformat-ruff
args:
- --wrap
- '88'
files: (docs/.)
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.5.0
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/mgedmin/check-manifest
rev: '0.49'
hooks:
- id: check-manifest
- id: nbstripout
exclude: |
(?x)^(
docs/source/estimagic/tutorials/estimation_tables_overview.ipynb|
docs/source/estimagic/explanation/bootstrap_montecarlo_comparison.ipynb|
)$
args:
- --no-build-isolation
- --drop-empty-cells
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
hooks:
- id: mypy
files: src|tests
additional_dependencies:
- setuptools-scm
- toml
- numpy<2.0
- packaging
- pandas-stubs
- sqlalchemy-stubs
- types-cffi
- types-openpyxl
- types-jinja2
args:
- --config=pyproject.toml
ci:
autoupdate_schedule: monthly
21 changes: 14 additions & 7 deletions .envs/testenv-linux.yml → .tools/envs/testenv-linux.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
name: estimagic
name: optimagic
channels:
- conda-forge
- nodefaults
dependencies:
- petsc4py
- jax
- pygmo
- cyipopt>=1.4.0 # dev, tests
- pygmo>=2.19.0 # dev, tests
- nlopt # dev, tests
- pip # dev, tests, docs
- pytest # dev, tests
- pytest-cov # tests
- pytest-xdist # dev, tests
- statsmodels # dev, tests
- bokeh<=2.4.3 # run, tests
- click # run, tests
- cloudpickle # run, tests
- joblib # run, tests
- numpy<2.0 # run, tests
Expand All @@ -22,12 +22,19 @@ dependencies:
- pybaum >= 0.1.2 # run, tests
- scipy>=1.2.1 # run, tests
- sqlalchemy # run, tests
- tranquilo>=0.0.4 # dev, tests
- seaborn # dev, tests
- mypy>=1.11 # dev, tests
- pyyaml # dev, tests
- jinja2 # dev, tests
- annotated-types # dev, tests
- pip: # dev, tests, docs
- DFO-LS # dev, tests
- Py-BOBYQA # dev, tests
- fides==0.7.4 # dev, tests
- kaleido # dev, tests
- simoptlib==1.0.1 # dev, tests
- -e ../
- pandas-stubs # dev, tests
- types-cffi # dev, tests
- types-openpyxl # dev, tests
- types-jinja2 # dev, tests
- sqlalchemy-stubs # dev, tests
- -e ../../
20 changes: 13 additions & 7 deletions .envs/testenv-others.yml → .tools/envs/testenv-others.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
---
name: estimagic
name: optimagic
channels:
- conda-forge
- nodefaults
dependencies:
- cyipopt<=1.2.0
- cyipopt>=1.4.0 # dev, tests
- pygmo>=2.19.0 # dev, tests
- nlopt # dev, tests
- pip # dev, tests, docs
- pytest # dev, tests
- pytest-cov # tests
- pytest-xdist # dev, tests
- statsmodels # dev, tests
- bokeh<=2.4.3 # run, tests
- click # run, tests
- cloudpickle # run, tests
- joblib # run, tests
- numpy<2.0 # run, tests
Expand All @@ -21,12 +20,19 @@ dependencies:
- pybaum >= 0.1.2 # run, tests
- scipy>=1.2.1 # run, tests
- sqlalchemy # run, tests
- tranquilo>=0.0.4 # dev, tests
- seaborn # dev, tests
- mypy>=1.11 # dev, tests
- pyyaml # dev, tests
- jinja2 # dev, tests
- annotated-types # dev, tests
- pip: # dev, tests, docs
- DFO-LS # dev, tests
- Py-BOBYQA # dev, tests
- fides==0.7.4 # dev, tests
- kaleido # dev, tests
- simoptlib==1.0.1 # dev, tests
- -e ../
- pandas-stubs # dev, tests
- types-cffi # dev, tests
- types-openpyxl # dev, tests
- types-jinja2 # dev, tests
- sqlalchemy-stubs # dev, tests
- -e ../../
Loading

0 comments on commit 16c59f7

Please sign in to comment.