Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipy setup #38

Merged
merged 1 commit into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 1 addition & 1 deletion DeepINN/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0"
__version__ = "1.0.0"
22 changes: 11 additions & 11 deletions Tutorials/5. FCNN/2. test.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -107,9 +107,9 @@
{
"data": {
"text/plain": [
"tensor([[0.0000],\n",
" [0.1072],\n",
" [0.1284]], grad_fn=<AddmmBackward0>)"
"tensor([[-0.0178],\n",
" [ 0.0000],\n",
" [-0.0185]], grad_fn=<AddmmBackward0>)"
]
},
"execution_count": 7,
Expand All @@ -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,
Expand Down Expand Up @@ -161,7 +161,7 @@
}
],
"source": [
"loss_metric = dp.domain.loss_metric(\"MSE\")\n",
"loss_metric = dp.backend.loss_metric(\"MSE\")\n",
"loss_metric\n"
]
},
Expand All @@ -173,7 +173,7 @@
{
"data": {
"text/plain": [
"tensor(2.7000, grad_fn=<MseLossBackward0>)"
"tensor(0.9703, grad_fn=<MseLossBackward0>)"
]
},
"execution_count": 10,
Expand Down
30 changes: 30 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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",
]
)