diff --git a/.envs/testenv.yml b/.envs/testenv.yml index e76f6f30..927e21c1 100644 --- a/.envs/testenv.yml +++ b/.envs/testenv.yml @@ -8,13 +8,6 @@ dependencies: - setuptools_scm - toml - # Package dependencies - - dags - - jax>=0.4.10 - - jaxlib>=0.4.10 - - numpy - - pandas - # Testing dependencies - scipy - pybaum @@ -24,6 +17,6 @@ dependencies: - pytest-cov - pytest-xdist - # Install lcm locally + # Install lcm and its dependencies locally - pip: - -e ../ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aa0ab222..2be8070d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,8 +31,7 @@ jobs: environment-file: ./.envs/testenv.yml environment-name: lcm cache-environment: true - create-args: > - extra-specs: | + create-args: >- python=${{ matrix.python-version }} - name: run pytest shell: bash -l {0} @@ -40,7 +39,7 @@ jobs: micromamba activate lcm pytest --cov-report=xml --cov=./ - name: Upload coverage report. - if: runner.os == 'Linux' && matrix.python-version == '3.10' + if: runner.os == 'Linux' && matrix.python-version == '3.11' uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 060d3067..137c54d8 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -7,10 +7,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: Install pypa/build run: >- python -m diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 25bc960f..6d1270fa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,7 +45,7 @@ repos: hooks: - id: yamllint - repo: https://github.com/psf/black - rev: 23.11.0 + rev: 24.1.1 hooks: - id: black language_version: python3.11 @@ -54,13 +54,13 @@ repos: hooks: - id: blacken-docs - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.6 + rev: v0.2.0 hooks: - id: ruff # args: # - --verbose - repo: https://github.com/kynan/nbstripout - rev: 0.6.1 + rev: 0.7.1 hooks: - id: nbstripout args: diff --git a/docs/source/conf.py b/docs/source/conf.py index ac389919..b52ca7e4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -9,6 +9,7 @@ documentation root, use os.path.abspath to make it absolute, like shown here. """ + import pathlib import sys diff --git a/setup.cfg b/setup.cfg index 51e6019e..18891142 100644 --- a/setup.cfg +++ b/setup.cfg @@ -29,11 +29,11 @@ keywords = packages = find: install_requires = dags - jax>=0.3.0 - jaxlib>=0.3.0 + jax>=0.4.10 + jaxlib>=0.4.10 numpy pandas -python_requires = >=3.10 +python_requires = >=3.11 include_package_data = True package_dir = =src diff --git a/setup.py b/setup.py index 94e80b5f..fa18fc5f 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ """Setup script for the package.""" + from setuptools import setup if __name__ == "__main__": diff --git a/src/lcm/create_params.py b/src/lcm/create_params.py index 962ec075..8ed0687e 100644 --- a/src/lcm/create_params.py +++ b/src/lcm/create_params.py @@ -1,4 +1,5 @@ """Create a parameters for a model specification.""" + import inspect import numpy as np diff --git a/src/lcm/discrete_emax.py b/src/lcm/discrete_emax.py index d9422a77..ec959c83 100644 --- a/src/lcm/discrete_emax.py +++ b/src/lcm/discrete_emax.py @@ -20,6 +20,7 @@ https://github.com/google/jax/issues/6265 """ + from functools import partial import jax diff --git a/src/lcm/distributions.py b/src/lcm/distributions.py index 568f60ca..aeffc60f 100644 --- a/src/lcm/distributions.py +++ b/src/lcm/distributions.py @@ -4,6 +4,7 @@ in JAX. """ + import numpy as np diff --git a/src/lcm/example_models.py b/src/lcm/example_models.py index 1186f910..8ae9a442 100644 --- a/src/lcm/example_models.py +++ b/src/lcm/example_models.py @@ -1,4 +1,5 @@ """Define example model specifications.""" + import jax.numpy as jnp RETIREMENT_AGE = 65 diff --git a/src/lcm/example_models_stochastic.py b/src/lcm/example_models_stochastic.py index 1be398d7..169e9c1b 100644 --- a/src/lcm/example_models_stochastic.py +++ b/src/lcm/example_models_stochastic.py @@ -1,4 +1,5 @@ """Define example model specifications.""" + import jax.numpy as jnp import lcm diff --git a/src/lcm/functools.py b/src/lcm/functools.py index 7972c130..ea51021a 100644 --- a/src/lcm/functools.py +++ b/src/lcm/functools.py @@ -67,9 +67,11 @@ def allow_kwargs(func): # Create new signature without positional-only arguments new_parameters = [ - p.replace(kind=inspect.Parameter.POSITIONAL_OR_KEYWORD) - if p.kind == inspect.Parameter.POSITIONAL_ONLY - else p + ( + p.replace(kind=inspect.Parameter.POSITIONAL_OR_KEYWORD) + if p.kind == inspect.Parameter.POSITIONAL_ONLY + else p + ) for p in parameters.values() ] new_signature = signature.replace(parameters=new_parameters) @@ -117,9 +119,11 @@ def allow_args(func): # Create new signature without keyword-only arguments new_parameters = [ - p.replace(kind=inspect.Parameter.POSITIONAL_OR_KEYWORD) - if p.kind == inspect.Parameter.KEYWORD_ONLY - else p + ( + p.replace(kind=inspect.Parameter.POSITIONAL_OR_KEYWORD) + if p.kind == inspect.Parameter.KEYWORD_ONLY + else p + ) for p in parameters.values() ] new_signature = signature.replace(parameters=new_parameters) diff --git a/src/lcm/get_model.py b/src/lcm/get_model.py index 200dce64..9687f81e 100644 --- a/src/lcm/get_model.py +++ b/src/lcm/get_model.py @@ -1,4 +1,5 @@ """Get a user model and parameters.""" + from typing import NamedTuple from pybaum import tree_update diff --git a/src/lcm/grids.py b/src/lcm/grids.py index e235a67b..84f10d32 100644 --- a/src/lcm/grids.py +++ b/src/lcm/grids.py @@ -17,6 +17,7 @@ it easy to call functions interchangeably. """ + import jax.numpy as jnp diff --git a/src/lcm/mark.py b/src/lcm/mark.py index 8c615d4b..8e5574ae 100644 --- a/src/lcm/mark.py +++ b/src/lcm/mark.py @@ -1,4 +1,5 @@ """Collection of LCM marking decorators.""" + import functools from typing import NamedTuple diff --git a/src/lcm/next_state.py b/src/lcm/next_state.py index ffe88123..220cb77a 100644 --- a/src/lcm/next_state.py +++ b/src/lcm/next_state.py @@ -6,6 +6,7 @@ deteministic next states. """ + from dags import concatenate_functions from dags.signature import with_signature diff --git a/src/lcm/sandbox/interpolation.ipynb b/src/lcm/sandbox/interpolation.ipynb index 216df89f..e6d2ef39 100644 --- a/src/lcm/sandbox/interpolation.ipynb +++ b/src/lcm/sandbox/interpolation.ipynb @@ -3,7 +3,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da0bbbc9", + "id": "0", "metadata": {}, "outputs": [], "source": [ @@ -24,7 +24,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c31af18", + "id": "1", "metadata": {}, "outputs": [], "source": [ @@ -46,7 +46,7 @@ }, { "cell_type": "markdown", - "id": "adc65243", + "id": "2", "metadata": {}, "source": [ "## 1d Benchmarks" @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86f352f5", + "id": "3", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ { "cell_type": "code", "execution_count": null, - "id": "46e61c87", + "id": "4", "metadata": {}, "outputs": [], "source": [ @@ -114,7 +114,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f9062cb", + "id": "5", "metadata": {}, "outputs": [], "source": [ @@ -126,7 +126,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55bc8605", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -138,7 +138,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62bb0133", + "id": "7", "metadata": {}, "outputs": [], "source": [ @@ -148,7 +148,7 @@ }, { "cell_type": "markdown", - "id": "8a071d57", + "id": "8", "metadata": {}, "source": [ "## 2d Benchmarks" @@ -157,7 +157,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7db8a854", + "id": "9", "metadata": {}, "outputs": [], "source": [ @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ff7b5ed0", + "id": "10", "metadata": {}, "outputs": [], "source": [ @@ -211,7 +211,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a8a6787", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -223,7 +223,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5401c149", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "216b4e52", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -251,7 +251,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a76907f9", + "id": "14", "metadata": {}, "outputs": [], "source": [] diff --git a/src/lcm/sandbox/interpolation_CZ.ipynb b/src/lcm/sandbox/interpolation_CZ.ipynb index 3a50177f..4706f4f3 100644 --- a/src/lcm/sandbox/interpolation_CZ.ipynb +++ b/src/lcm/sandbox/interpolation_CZ.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "88a8bcb5-4dd5-46a2-bf2c-5d4638f69373", + "id": "0", "metadata": { "jp-MarkdownHeadingCollapsed": true, "tags": [] @@ -15,7 +15,7 @@ }, { "cell_type": "markdown", - "id": "fbd2f0cc-bcd6-4f87-adfc-cfb30a12c214", + "id": "1", "metadata": { "tags": [] }, @@ -28,7 +28,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da0bbbc9", + "id": "2", "metadata": {}, "outputs": [], "source": [ @@ -59,7 +59,7 @@ { "cell_type": "code", "execution_count": null, - "id": "43065f2b-50c5-4a5a-9ae4-420cc04bbc5d", + "id": "3", "metadata": {}, "outputs": [], "source": [ @@ -87,7 +87,7 @@ }, { "cell_type": "markdown", - "id": "4712a060-0b73-4efa-8adf-5ed39490664f", + "id": "4", "metadata": { "tags": [] }, @@ -97,7 +97,7 @@ }, { "cell_type": "markdown", - "id": "d8ab306a-14c5-4a49-88b6-18387a1443c4", + "id": "5", "metadata": { "tags": [] }, @@ -108,7 +108,7 @@ { "cell_type": "code", "execution_count": null, - "id": "61901839-f1b2-43bd-98a8-929313d8d326", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -141,7 +141,7 @@ { "cell_type": "code", "execution_count": null, - "id": "82ac9175-0eaa-4785-86f0-ab45792784e0", + "id": "7", "metadata": {}, "outputs": [], "source": [ @@ -150,7 +150,7 @@ }, { "cell_type": "markdown", - "id": "74d397a3-9a4d-4b4f-ab13-1cf0a2798ac5", + "id": "8", "metadata": { "tags": [] }, @@ -161,7 +161,7 @@ { "cell_type": "code", "execution_count": null, - "id": "391ca604-64d4-416c-9ff2-acd1ad151a9e", + "id": "9", "metadata": {}, "outputs": [], "source": [ @@ -174,7 +174,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8ee9dc11-96f2-436f-84c1-cf2a7b307ce3", + "id": "10", "metadata": {}, "outputs": [], "source": [ @@ -188,7 +188,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cb571715-61e0-4bdf-b455-4fd745d396fe", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -202,7 +202,7 @@ { "cell_type": "code", "execution_count": null, - "id": "88fe356a-3dd2-40cb-9e13-823be184d5ed", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -216,7 +216,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d5c4d1bf-9942-4e2a-a957-857626cf33c0", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -244,7 +244,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e49752c1-e1a3-45de-a7ec-1a3693569cba", + "id": "14", "metadata": {}, "outputs": [], "source": [ @@ -276,7 +276,7 @@ { "cell_type": "code", "execution_count": null, - "id": "75cd90dc-40a3-4956-a632-a6aa3dbeefee", + "id": "15", "metadata": {}, "outputs": [], "source": [ @@ -286,7 +286,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4822d173-884e-484c-9f45-fe2f844bb318", + "id": "16", "metadata": {}, "outputs": [], "source": [ @@ -296,7 +296,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd7c8e05-5fb1-4981-afad-fa31e25d09ae", + "id": "17", "metadata": {}, "outputs": [], "source": [ @@ -328,7 +328,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fd0ff7ca-c2cc-4b30-9418-2d2ca356e928", + "id": "18", "metadata": {}, "outputs": [], "source": [ @@ -338,7 +338,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7c1cb118-7f70-43cc-8c77-9a812c86f282", + "id": "19", "metadata": {}, "outputs": [], "source": [ @@ -391,7 +391,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b7b368c-271b-4acc-b0a9-7637f0fdcd12", + "id": "20", "metadata": {}, "outputs": [], "source": [ @@ -424,7 +424,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1d067e54-a14f-40c3-bcf9-1c1f89c53c31", + "id": "21", "metadata": {}, "outputs": [], "source": [ @@ -434,7 +434,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c179df37-994f-4685-a280-e80a1f50b25d", + "id": "22", "metadata": {}, "outputs": [], "source": [ @@ -444,7 +444,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1220277-fd53-4500-8792-4c0e5525c3f2", + "id": "23", "metadata": {}, "outputs": [], "source": [ @@ -456,7 +456,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4cddc12-018e-42b1-aaf8-dc492d902836", + "id": "24", "metadata": {}, "outputs": [], "source": [] @@ -464,7 +464,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ce694682-629f-472d-9470-51840900878e", + "id": "25", "metadata": {}, "outputs": [], "source": [ @@ -474,7 +474,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d391bae-8c6f-476d-afca-21efdd5a0d8f", + "id": "26", "metadata": {}, "outputs": [], "source": [ @@ -484,7 +484,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6cd5229a-aac3-4117-a637-387eaff74030", + "id": "27", "metadata": {}, "outputs": [], "source": [ @@ -516,7 +516,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bbb64a66-6ca8-4730-97d0-3ec9a03a2a8b", + "id": "28", "metadata": {}, "outputs": [], "source": [ @@ -526,7 +526,7 @@ { "cell_type": "code", "execution_count": null, - "id": "04698846-657e-403d-946f-8bef17a4b3a4", + "id": "29", "metadata": {}, "outputs": [], "source": [ @@ -556,7 +556,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3332834d-8a2c-4e91-923c-38b2608afa9f", + "id": "30", "metadata": {}, "outputs": [], "source": [ @@ -566,7 +566,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4904dcda-1dc5-4f11-89ce-c7d1992a43b3", + "id": "31", "metadata": {}, "outputs": [], "source": [ @@ -606,7 +606,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e90de0d-ce0a-4ac9-a13a-3efbb1ee4a2f", + "id": "32", "metadata": {}, "outputs": [], "source": [ @@ -638,7 +638,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d7a82ba1-6ddc-41ab-9c5e-a91172f548cd", + "id": "33", "metadata": {}, "outputs": [], "source": [ @@ -671,7 +671,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4c5393f9-c6e3-472e-a720-7b84cdd89539", + "id": "34", "metadata": {}, "outputs": [], "source": [ @@ -681,7 +681,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1c31af18", + "id": "35", "metadata": {}, "outputs": [], "source": [ @@ -703,7 +703,7 @@ }, { "cell_type": "markdown", - "id": "adc65243", + "id": "36", "metadata": {}, "source": [ "## 1d Benchmarks" @@ -712,7 +712,7 @@ { "cell_type": "code", "execution_count": null, - "id": "86f352f5", + "id": "37", "metadata": {}, "outputs": [], "source": [ @@ -759,7 +759,7 @@ { "cell_type": "code", "execution_count": null, - "id": "46e61c87", + "id": "38", "metadata": {}, "outputs": [], "source": [ @@ -771,7 +771,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f9062cb", + "id": "39", "metadata": {}, "outputs": [], "source": [ @@ -783,7 +783,7 @@ { "cell_type": "code", "execution_count": null, - "id": "55bc8605", + "id": "40", "metadata": {}, "outputs": [], "source": [ @@ -795,7 +795,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62bb0133", + "id": "41", "metadata": {}, "outputs": [], "source": [ @@ -805,7 +805,7 @@ }, { "cell_type": "markdown", - "id": "e6f839d8-58a9-4465-91be-bbafc26f1aed", + "id": "42", "metadata": {}, "source": [ "# Sandbox" @@ -813,7 +813,7 @@ }, { "cell_type": "markdown", - "id": "b68b9fbc-cd07-4fca-85dd-b5dd605c7097", + "id": "43", "metadata": {}, "source": [ "Janos' idea: constant growth of the differences" @@ -822,7 +822,7 @@ { "cell_type": "code", "execution_count": null, - "id": "42328250-8901-44f8-bcf9-82367f8a24f8", + "id": "44", "metadata": {}, "outputs": [], "source": [ @@ -838,7 +838,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1cf8946b-76ed-49e2-963d-5e44724876f1", + "id": "45", "metadata": {}, "outputs": [], "source": [ @@ -848,7 +848,7 @@ { "cell_type": "code", "execution_count": null, - "id": "be6347fe-963e-403f-9c8b-fe4fedc019e7", + "id": "46", "metadata": {}, "outputs": [], "source": [] diff --git a/src/lcm/sandbox/interpolation_jax_versus_scipy.ipynb b/src/lcm/sandbox/interpolation_jax_versus_scipy.ipynb index 079507fb..288c156b 100644 --- a/src/lcm/sandbox/interpolation_jax_versus_scipy.ipynb +++ b/src/lcm/sandbox/interpolation_jax_versus_scipy.ipynb @@ -3,7 +3,7 @@ { "cell_type": "code", "execution_count": null, - "id": "374bd5f6", + "id": "0", "metadata": {}, "outputs": [], "source": [ @@ -26,7 +26,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a6ce66f9", + "id": "1", "metadata": {}, "outputs": [], "source": [ @@ -48,7 +48,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2393629d", + "id": "2", "metadata": {}, "outputs": [], "source": [ @@ -67,14 +67,14 @@ { "cell_type": "code", "execution_count": null, - "id": "bc79d3b4", + "id": "3", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", - "id": "f27c1850", + "id": "4", "metadata": {}, "source": [ "## 1d Benchmarks" @@ -83,7 +83,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16441023", + "id": "5", "metadata": {}, "outputs": [], "source": [ @@ -123,7 +123,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b894def", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -135,7 +135,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f392f399", + "id": "7", "metadata": {}, "outputs": [], "source": [ @@ -147,7 +147,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45c0779a", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -159,7 +159,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b5926ec", + "id": "9", "metadata": {}, "outputs": [], "source": [ @@ -170,14 +170,14 @@ { "cell_type": "code", "execution_count": null, - "id": "4e0015c3", + "id": "10", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", - "id": "c1e91a59", + "id": "11", "metadata": {}, "source": [ "## 2d Benchmarks" @@ -186,7 +186,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4d10031", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -236,7 +236,7 @@ { "cell_type": "code", "execution_count": null, - "id": "98630a3f", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -248,7 +248,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6a116c0c", + "id": "14", "metadata": {}, "outputs": [], "source": [ @@ -260,7 +260,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9c0a3a59", + "id": "15", "metadata": {}, "outputs": [], "source": [ @@ -272,7 +272,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dd8a4a6f", + "id": "16", "metadata": {}, "outputs": [], "source": [ @@ -284,7 +284,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a8e24ea6", + "id": "17", "metadata": {}, "outputs": [], "source": [ @@ -295,14 +295,14 @@ { "cell_type": "code", "execution_count": null, - "id": "fde1df58", + "id": "18", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", - "id": "b49d0db1", + "id": "19", "metadata": {}, "source": [ "## 3d Benchmarks" @@ -311,7 +311,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ef2fb2a2", + "id": "20", "metadata": {}, "outputs": [], "source": [ @@ -370,7 +370,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e043503a", + "id": "21", "metadata": {}, "outputs": [], "source": [ @@ -382,7 +382,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3945c4fb", + "id": "22", "metadata": {}, "outputs": [], "source": [ @@ -394,7 +394,7 @@ { "cell_type": "code", "execution_count": null, - "id": "558c05d5", + "id": "23", "metadata": {}, "outputs": [], "source": [ @@ -406,7 +406,7 @@ { "cell_type": "code", "execution_count": null, - "id": "feb517ee", + "id": "24", "metadata": {}, "outputs": [], "source": [ @@ -417,14 +417,14 @@ { "cell_type": "code", "execution_count": null, - "id": "552a875c", + "id": "25", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", - "id": "f5853083", + "id": "26", "metadata": {}, "source": [ "## 4d Benchmarks" @@ -433,7 +433,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c94dab22", + "id": "27", "metadata": {}, "outputs": [], "source": [ @@ -502,7 +502,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3f93ba79", + "id": "28", "metadata": {}, "outputs": [], "source": [ @@ -514,7 +514,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e7578ba4", + "id": "29", "metadata": {}, "outputs": [], "source": [ @@ -526,7 +526,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eae59b55", + "id": "30", "metadata": {}, "outputs": [], "source": [ @@ -538,7 +538,7 @@ { "cell_type": "code", "execution_count": null, - "id": "186a2354", + "id": "31", "metadata": {}, "outputs": [], "source": [ @@ -549,7 +549,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c0a00cab", + "id": "32", "metadata": {}, "outputs": [], "source": [] diff --git a/src/lcm/sandbox/state_space_jax_versus_numba.ipynb b/src/lcm/sandbox/state_space_jax_versus_numba.ipynb index 48e5e632..eed62775 100644 --- a/src/lcm/sandbox/state_space_jax_versus_numba.ipynb +++ b/src/lcm/sandbox/state_space_jax_versus_numba.ipynb @@ -3,7 +3,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5d844b48", + "id": "0", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "341e9476", + "id": "1", "metadata": {}, "outputs": [], "source": [ @@ -48,7 +48,7 @@ }, { "cell_type": "markdown", - "id": "2bba9018", + "id": "2", "metadata": {}, "source": [ "## product_map: 2 grids benchmark" @@ -56,7 +56,7 @@ }, { "cell_type": "markdown", - "id": "13fd21b6", + "id": "3", "metadata": {}, "source": [ "### Trivial setup" @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0a6c246b", + "id": "4", "metadata": {}, "outputs": [], "source": [ @@ -83,7 +83,7 @@ }, { "cell_type": "markdown", - "id": "1f3a7cc2", + "id": "5", "metadata": {}, "source": [ "### Numba: Dimensions hardcoded" @@ -92,7 +92,7 @@ { "cell_type": "code", "execution_count": null, - "id": "10a72f5c", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "fa089aa4", + "id": "7", "metadata": {}, "source": [ "### LCM productmap" @@ -126,7 +126,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6f687b34", + "id": "8", "metadata": {}, "outputs": [], "source": [ @@ -146,7 +146,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a395abf7", + "id": "9", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ { "cell_type": "code", "execution_count": null, - "id": "904b3fae", + "id": "10", "metadata": {}, "outputs": [], "source": [ @@ -214,7 +214,7 @@ { "cell_type": "code", "execution_count": null, - "id": "46155cdf", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -224,7 +224,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dca5d16d", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -234,7 +234,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d6f1b354", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -243,7 +243,7 @@ }, { "cell_type": "markdown", - "id": "74e0d4be", + "id": "14", "metadata": {}, "source": [ "## *product_map*: 4 grids benchmark, more complex computations" @@ -252,7 +252,7 @@ { "cell_type": "code", "execution_count": null, - "id": "737050d7", + "id": "15", "metadata": {}, "outputs": [], "source": [ @@ -291,7 +291,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3dd249c5", + "id": "16", "metadata": {}, "outputs": [], "source": [ @@ -328,7 +328,7 @@ { "cell_type": "code", "execution_count": null, - "id": "214b14e0", + "id": "17", "metadata": {}, "outputs": [], "source": [ @@ -401,7 +401,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8671be04", + "id": "18", "metadata": {}, "outputs": [], "source": [ @@ -411,7 +411,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c90fc304", + "id": "19", "metadata": {}, "outputs": [], "source": [ @@ -421,7 +421,7 @@ { "cell_type": "code", "execution_count": null, - "id": "218d50b8", + "id": "20", "metadata": {}, "outputs": [], "source": [ @@ -430,7 +430,7 @@ }, { "cell_type": "markdown", - "id": "094b6ac5", + "id": "21", "metadata": {}, "source": [ "## *gridmap*: 4 grids benchmark" @@ -439,7 +439,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a689327f", + "id": "22", "metadata": {}, "outputs": [], "source": [ @@ -464,7 +464,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0a1c090d", + "id": "23", "metadata": {}, "outputs": [], "source": [ @@ -499,7 +499,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7fdb8c14", + "id": "24", "metadata": {}, "outputs": [], "source": [ @@ -526,7 +526,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3aa9c397", + "id": "25", "metadata": {}, "outputs": [], "source": [ @@ -600,7 +600,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6254177f", + "id": "26", "metadata": {}, "outputs": [], "source": [ @@ -610,7 +610,7 @@ { "cell_type": "code", "execution_count": null, - "id": "452dd808", + "id": "27", "metadata": {}, "outputs": [], "source": [ @@ -620,7 +620,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9d33bacf", + "id": "28", "metadata": {}, "outputs": [], "source": [ @@ -629,7 +629,7 @@ }, { "cell_type": "markdown", - "id": "5336d404", + "id": "29", "metadata": {}, "source": [ "## 4d Benchmark with multiple targets and product_map" @@ -638,7 +638,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e4db7ad", + "id": "30", "metadata": {}, "outputs": [], "source": [ @@ -681,7 +681,7 @@ { "cell_type": "code", "execution_count": null, - "id": "528034b7", + "id": "31", "metadata": {}, "outputs": [], "source": [ @@ -714,7 +714,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9b178292", + "id": "32", "metadata": {}, "outputs": [], "source": [ @@ -782,7 +782,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1cebd4f7", + "id": "33", "metadata": {}, "outputs": [], "source": [ @@ -792,7 +792,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a70dbc40", + "id": "34", "metadata": {}, "outputs": [], "source": [ @@ -802,7 +802,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c705a86a", + "id": "35", "metadata": {}, "outputs": [], "source": [ @@ -812,7 +812,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8d11bfd6", + "id": "36", "metadata": {}, "outputs": [], "source": [] diff --git a/src/lcm/state_space.py b/src/lcm/state_space.py index ba4bf66a..44f3b8bc 100644 --- a/src/lcm/state_space.py +++ b/src/lcm/state_space.py @@ -1,4 +1,5 @@ """Create a state space for a given model.""" + import inspect import jax diff --git a/tests/test_analytical_solution.py b/tests/test_analytical_solution.py index 42a384db..2cf0abda 100644 --- a/tests/test_analytical_solution.py +++ b/tests/test_analytical_solution.py @@ -1,4 +1,5 @@ """Testing against the analytical solution by Iskhakov et al (2017).""" + import numpy as np import pytest from lcm._config import TEST_DATA_PATH