Merge pull request #4 from zweien/dev

Update github actions for pypi, docker.
This commit is contained in:
zweien 2021-07-15 12:54:34 +08:00 committed by GitHub
commit 96a935d466
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 84 additions and 24 deletions

View File

@ -2,10 +2,11 @@ name: docker-build-push
on:
push:
branches: [master]
pull_request:
branches: [master]
release:
types: [published, created, edited]
types: [published, edited]
jobs:
@ -25,15 +26,8 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/idrlnet:latest
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
name: Print event_name
run: echo "$GITHUB_EVENT_NAME, ${{ github.event_name }}, ${{ github.event.release.tag_name }}"
-
name: Get release version
@ -48,3 +42,4 @@ jobs:
with:
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/idrlnet:${{ steps.get_version.outputs.RELEASE_VERSION }}
file: Dockerfile

40
.github/workflows/pypi.yml vendored Normal file
View File

@ -0,0 +1,40 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Publish to PyPI
on:
release:
types: [published, edited]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.7]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel twine
- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload --repository-url dist/*
- name: Install from PyPI
run: |
pip install -U idrlnet
pip show idrlnet

View File

@ -2,33 +2,45 @@
[![Python](https://img.shields.io/badge/python-3.8-blue.svg)](https://python.org)
[![Documentation Status](https://readthedocs.org/projects/idrlnet/badge/?version=latest)](https://idrlnet.readthedocs.io/en/latest/?badge=latest)
# IDRLnet
**IDRLnet** is a machine learning library on top of [PyTorch](https://pytorch.org/). Use IDRLnet if you need a machine
learning library that solves both forward and inverse differential equations via physics-informed neural
networks (PINN). IDRLnet is a flexible framework inspired by [Nvidia Simnet](https://developer.nvidia.com/simnet>).
## Installation
Choose one of the following installation methods.
### PyPI
Simple installation from PyPI
```bash
pip install -U idrlnet
```
Note: To avoid version conflicts, please use some tools to create a virtual environment first.
### Docker
```bash
git clone https://github.com/idrl-lab/idrlnet
cd idrlnet
docker build . -t idrlnet_dev
docker run -it -p [EXPOSED_SSH_PORT]:22 -v [CURRENT_WORK_DIR]:/root/pinnnet idrlnet_dev:latest bash
docker pull idrl/idrlnet:latest
```
### Anaconda
```bash
### From Source
```
git clone https://github.com/idrl-lab/idrlnet
cd idrlnet
conda create -n idrlnet_dev python=3.8 -y
conda activate idrlnet_dev
pip install -r requirements.txt
pip install -e .
```
# IDRLnet
IDRLnet is a machine learning library on top of [Pytorch](https://www.tensorflow.org/). Use IDRLnet if you need a machine
learning library that solves both forward and inverse partial differential equations (PDEs) via physics-informed neural
networks (PINN). IDRLnet is a flexible framework inspired by [Nvidia Simnet](https://developer.nvidia.com/simnet>).
## Features
@ -81,3 +93,16 @@ First off, thanks for taking the time to contribute!
IDRLnet was originally developed by IDRL lab.
## Citation
Feel free to cite this library.
```bibtex
@article{peng2021idrlnet,
title={IDRLnet: A Physics-Informed Neural Network Library},
author={Wei Peng and Jun Zhang and Weien Zhou and Xiaoyu Zhao and Wen Yao and Xiaoqian Chen},
year={2021},
eprint={2107.04320},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
```