diff --git a/.github/workflows/doctest.yml b/.github/workflows/doctest.yml new file mode 100644 index 0000000..02084cc --- /dev/null +++ b/.github/workflows/doctest.yml @@ -0,0 +1,30 @@ +name: doc tests + +on: + pull_request: + +jobs: + test: + name: Python ${{ matrix.python-version }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: "pip" + + - name: Install dependencies + run: | + pip install --upgrade pip + pip install torch --index-url https://download.pytorch.org/whl/cpu + pip install -e ".[dev]" + + - name: Run doctests + run: pytest --doctest-modules codegen.py type_checker.py utils/ -v --tb=short diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..5c23983 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,30 @@ +name: unit tests + +on: + pull_request: + +jobs: + test: + name: Python ${{ matrix.python-version }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: "pip" + + - name: Install dependencies + run: | + pip install --upgrade pip + pip install torch --index-url https://download.pytorch.org/whl/cpu + pip install -e ".[dev]" + + - name: Run pytest + run: pytest tests/ -v --tb=short diff --git a/physika.egg-info/PKG-INFO b/physika.egg-info/PKG-INFO new file mode 100644 index 0000000..81566db --- /dev/null +++ b/physika.egg-info/PKG-INFO @@ -0,0 +1,19 @@ +Metadata-Version: 2.4 +Name: physika +Version: 0.1.0 +Home-page: https://github.com/deepforestsci/physika +License: MIT +Project-URL: Source, https://github.com/deepforestsci/physika +Requires-Python: >=3.9 +License-File: LICENSE +Requires-Dist: torch +Requires-Dist: ply +Provides-Extra: dev +Requires-Dist: pytest>=7; extra == "dev" +Dynamic: home-page +Dynamic: license +Dynamic: license-file +Dynamic: project-url +Dynamic: provides-extra +Dynamic: requires-dist +Dynamic: requires-python diff --git a/physika.egg-info/SOURCES.txt b/physika.egg-info/SOURCES.txt new file mode 100644 index 0000000..3f2030c --- /dev/null +++ b/physika.egg-info/SOURCES.txt @@ -0,0 +1,46 @@ +LICENSE +README.md +pyproject.toml +setup.py +examples/ast/example_arrays.py +examples/ast/example_matrices.py +examples/ast/example_tensors.py +examples/ast/factorial.py +examples/ast/fft.py +examples/ast/for.py +examples/ast/harmonic_oscillator.py +examples/ast/hnn.py +examples/ast/networks.py +examples/ast/pendulum_rk4.py +examples/ast/spring_pendulum_rk4.py +examples/ast/train_fully_connected.py +examples/torch_code/example_arrays.py +examples/torch_code/example_matrices.py +examples/torch_code/example_tensors.py +examples/torch_code/factorial.py +examples/torch_code/fft.py +examples/torch_code/for.py +examples/torch_code/harmonic_oscillator.py +examples/torch_code/hnn.py +examples/torch_code/networks.py +examples/torch_code/pendulum_rk4.py +examples/torch_code/spring_pendulum_rk4.py +examples/torch_code/train_fully_connected.py +physika.egg-info/PKG-INFO +physika.egg-info/SOURCES.txt +physika.egg-info/dependency_links.txt +physika.egg-info/entry_points.txt +physika.egg-info/requires.txt +physika.egg-info/top_level.txt +tests/conftest.py +tests/test_codegen.py +tests/test_execute.py +tests/test_lexer.py +tests/test_physika.py +tests/test_typechecker.py +tests/test_utils/test_ast_utils.py +utils/__init__.py +utils/ast_utils.py +utils/parser_utils.py +utils/print_utils.py +utils/type_checker_utils.py \ No newline at end of file diff --git a/physika.egg-info/dependency_links.txt b/physika.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/physika.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/physika.egg-info/entry_points.txt b/physika.egg-info/entry_points.txt new file mode 100644 index 0000000..65255f8 --- /dev/null +++ b/physika.egg-info/entry_points.txt @@ -0,0 +1,2 @@ +[console_scripts] +physika = physika.execute:main diff --git a/physika.egg-info/requires.txt b/physika.egg-info/requires.txt new file mode 100644 index 0000000..f455d27 --- /dev/null +++ b/physika.egg-info/requires.txt @@ -0,0 +1,5 @@ +torch +ply + +[dev] +pytest>=7 diff --git a/physika.egg-info/top_level.txt b/physika.egg-info/top_level.txt new file mode 100644 index 0000000..9487075 --- /dev/null +++ b/physika.egg-info/top_level.txt @@ -0,0 +1 @@ +utils diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..9787c3b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..15f83b0 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +testpaths = tests +addopts = --tb=short diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..a54c927 --- /dev/null +++ b/setup.py @@ -0,0 +1,24 @@ +from setuptools import setup, find_packages + +setup(name="physika", + version="0.1.0", + url="https://github.com/deepforestsci/physika", + license='MIT', + python_requires=">=3.9", + install_requires=[ + "torch", + "ply", + ], + packages=find_packages(), + project_urls={ + 'Source': 'https://github.com/deepforestsci/physika', + }, + entry_points={ + "console_scripts": [ + "physika=physika.execute:main", + ], + }, + extras_require={ + "dev": ["pytest>=7"], + }, +)