From a91986fc54c3577f6c99a57cb9c89c8b450e0f81 Mon Sep 17 00:00:00 2001 From: Thomas Grandits Date: Fri, 4 Jun 2021 23:39:05 +0200 Subject: [PATCH] Updated python-publish Generated a new codecov token and updated badge to track the new branch Example in the documentation fixed --- .github/workflows/python-package.yml | 2 +- .github/workflows/python-publish.yml | 2 +- README.md | 2 +- docs/example.inc | 8 ++++---- fimpy/__init__.py | 2 +- setup.py | 2 +- tests/test_fim_solvers.py | 9 --------- 7 files changed, 9 insertions(+), 18 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 700895a..cd895be 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -39,7 +39,7 @@ jobs: - name: Test with pytest run: | python -m pytest --cov-config=.coveragerc_cpu --cov=fimpy tests/ - bash <(curl -s https://codecov.io/bash) -t 9ad55939-f54d-4aad-a7eb-fcd2d22d4ecd + bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }} - name: Test installation run: | diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 3bfabfc..2792cbd 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -28,7 +28,7 @@ jobs: python -m pip install --upgrade pip pip install build - name: Build package - run: python -m build + run: python -m build -s - name: Publish package uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: diff --git a/README.md b/README.md index 1702022..33ccc78 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Fast Iterative Method - Numpy/Cupy This repository implements the Fast Iterative Method on [tetrahedral domains](https://epubs.siam.org/doi/abs/10.1137/120881956) and [triangulated surfaces](https://epubs.siam.org/doi/abs/10.1137/100788951) purely in python both for CPU (numpy) and GPU (cupy). The main focus is however on the GPU implementation, since it can be better exploited for very large domains. -[![codecov](https://codecov.io/gh/thomgrand/fim-python/branch/main/graph/badge.svg?token=DG05WR5030)](https://codecov.io/gh/thomgrand/fim-python) +[![codecov](https://codecov.io/gh/thomgrand/fim-python/branch/master/graph/badge.svg?token=DG05WR5030)](https://codecov.io/gh/thomgrand/fim-python) [![CI Tests](https://github.com/thomgrand/fim-python/actions/workflows/python-package.yml/badge.svg)](https://github.com/thomgrand/fim-python/actions/workflows/python-package.yml) # Details diff --git a/docs/example.inc b/docs/example.inc index bcb1ca8..9198791 100644 --- a/docs/example.inc +++ b/docs/example.inc @@ -2,27 +2,27 @@ import numpy as np import cupy as cp - from fimpy import fim_solver + from fimpy.solver import FIMPY from scipy.spatial import Delaunay import matplotlib.pyplot as plt #Create triangulated points in 2D x = np.linspace(-1, 1, num=50) X, Y = np.meshgrid(x, x) - points = np.stack([X, Y], axis=-1).reshape([-1]).astype(np.float32) + points = np.stack([X, Y], axis=-1).reshape([-1, 2]).astype(np.float32) elems = Delaunay(points).simplices elem_centers = np.mean(points[elems], axis=1) #The domain will have a small spot where movement will be slow velocity_p = (1 / (1 + np.exp(3.5 - 25*np.linalg.norm(points - np.array([[0.33, 0.33]]), axis=-1)**2))) - velocity_e = (1 / (1 + np.exp(3.5 - 25*np.linalg.norm(elem_centers - np.array([[0.33, 0.33]]), axis=-1)**2))) + velocity_e = (1 / (1 + np.exp(3.5 - 25*np.linalg.norm(elem_centers - np.array([[0.33, 0.33]]), axis=-1)**2))) D = np.eye(2, dtype=np.float32)[np.newaxis] * velocity_e[..., np.newaxis, np.newaxis] #Isotropic propagation x0 = np.array([np.argmin(np.linalg.norm(points, axis=-1), axis=0)]) x0_vals = np.array([0.]) #Create a FIM solver, by default the GPU solver will be called with the active list - fim = fim_solver(points, elems, D) + fim = FIMPY.create_fim_solver(points, elems, D) phi = fim.comp_fim(x0, x0_vals) #Plot the data of all points to the given x0 at the center of the domain diff --git a/fimpy/__init__.py b/fimpy/__init__.py index 9331627..0943c3b 100644 --- a/fimpy/__init__.py +++ b/fimpy/__init__.py @@ -1,6 +1,6 @@ #TODO: Import all symbols and methods here from .solver import FIMPY -__version__ = "1.0.0" +__version__ = "1.0.1" __author__ = "Thomas Grandits" #__all__ = ["FIMPY"] \ No newline at end of file diff --git a/setup.py b/setup.py index 555c80e..4d3aaf2 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ long_description = readme.read() setup(name="fim-python", - version="1.0.0", + version="1.0.1", description="This repository implements the Fast Iterative Method on tetrahedral domains and triangulated surfaces purely in python both for CPU (numpy) and GPU (cupy).", long_description=long_description, long_description_content_type="text/markdown", diff --git a/tests/test_fim_solvers.py b/tests/test_fim_solvers.py index c5bbec4..cec1bfa 100644 --- a/tests/test_fim_solvers.py +++ b/tests/test_fim_solvers.py @@ -152,12 +152,3 @@ def test_comp(self, dims, elem_dims, precision, use_active_list, device='cpu'): @pytest.mark.parametrize('use_active_list', [True, False]) def test_comp_gpu(self, dims, elem_dims, precision, use_active_list): self.test_comp(dims, elem_dims, precision, use_active_list=use_active_list, device='gpu') - - #def test_init - #def test_1D_network - #def test_multidim_network - #def test_manifold - #def test_volumetric_model - -#if __name__ == "__main__": - #unittest.main() \ No newline at end of file