diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c1bed31 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: PyPI release 🐍📦 + +on: + workflow_dispatch: + release: + types: + - published + +jobs: + build-n-publish: + name: Build and publish 🐍 📦 to PyPI + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install pypa/setuptools + run: >- + python -m + pip install wheel + - name: Extract tag name + id: tag + run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3) + - name: Update version in setup.py + run: >- + sed -i "s/{{VERSION_PLACEHOLDER}}/${{ steps.tag.outputs.TAG_NAME }}/g" setup.py + - name: Build a binary wheel + run: >- + python setup.py sdist bdist_wheel + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file diff --git a/DeepINN/__about__.py b/DeepINN/__about__.py index f5fe964..d538f87 100644 --- a/DeepINN/__about__.py +++ b/DeepINN/__about__.py @@ -1 +1 @@ -__version__ = "1.0" \ No newline at end of file +__version__ = "1.0.0" \ No newline at end of file diff --git a/Tutorials/5. FCNN/2. test.ipynb b/Tutorials/5. FCNN/2. test.ipynb index 33c092a..1793f73 100644 --- a/Tutorials/5. FCNN/2. test.ipynb +++ b/Tutorials/5. FCNN/2. test.ipynb @@ -84,9 +84,9 @@ { "data": { "text/plain": [ - "tensor([[-2.7728],\n", - " [-0.4936],\n", - " [-0.0964]])" + "tensor([[ 0.9173],\n", + " [-0.5839],\n", + " [ 1.2837]])" ] }, "execution_count": 6, @@ -107,9 +107,9 @@ { "data": { "text/plain": [ - "tensor([[0.0000],\n", - " [0.1072],\n", - " [0.1284]], grad_fn=)" + "tensor([[-0.0178],\n", + " [ 0.0000],\n", + " [-0.0185]], grad_fn=)" ] }, "execution_count": 7, @@ -130,9 +130,9 @@ { "data": { "text/plain": [ - "tensor([[-0.9922],\n", - " [-0.4571],\n", - " [-0.0961]])" + "tensor([[ 0.7246],\n", + " [-0.5255],\n", + " [ 0.8575]])" ] }, "execution_count": 8, @@ -161,7 +161,7 @@ } ], "source": [ - "loss_metric = dp.domain.loss_metric(\"MSE\")\n", + "loss_metric = dp.backend.loss_metric(\"MSE\")\n", "loss_metric\n" ] }, @@ -173,7 +173,7 @@ { "data": { "text/plain": [ - "tensor(2.7000, grad_fn=)" + "tensor(0.9703, grad_fn=)" ] }, "execution_count": 10, diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..739ff97 --- /dev/null +++ b/setup.py @@ -0,0 +1,30 @@ +from setuptools import setup, find_packages +import codecs +import os + +# pwd +here = os.path.abspath(os.path.dirname(__file__)) + +# Long description of the project +with codecs.open(os.path.join(here, "README.md"), encoding="utf-8") as fh: + long_description = "\\n" + fh.read() + +setup( + name="DeepINN", + version='{{VERSION_PLACEHOLDER}}', + author="Prakhar Sharma", + author_email="prakhars962@gmail.com", + description="A Physics-informed neural network (PINN) library.", + url = "https://deepinn.readthedocs.io/en/latest/index.html", + long_description_content_type="text/markdown", + long_description=long_description, + packages=find_packages(), + install_requires=['numpy'], + keywords = ["Differential equations", "Physics-informed neural networks"], + classifiers=[ + "Development Status :: 4 - Beta", + "Intended Audience :: Science/Research", + "Programming Language :: Python :: 3", + "Operating System :: Unix", + ] +) \ No newline at end of file