diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..0c9762c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[BUG] - title of the issue" +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +for example: +1. use function XXX +2. insert this argument +3. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. Linux or Windows] + - em-interpolator version + - Python version + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..48ba471 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "[Feature request] - title of the issue" +labels: enhancement +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] or, it would be very handy to have [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/improve-documentation.md b/.github/ISSUE_TEMPLATE/improve-documentation.md new file mode 100644 index 0000000..d805327 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/improve-documentation.md @@ -0,0 +1,23 @@ +--- +name: Improve documentation +about: Help us improve our documentation +title: "[DOC] - title of the issue" +labels: documentation +assignees: '' + +--- + +# What were you looking for? +Please try to describe concisely what kind of information you were looking for and where you were looking. + +# Is the information available in the doc but not where you would expect? +let us know if you ended up finding the information you were looking for in another (unexpected) section of the doc. + +# Is information completely lacking or partial? +Please specify if you are asking for a better explanation/clarification of the text or if the information is completely lacking. + +# Where would you insert the missing information? +Describe here where you would put the information. + +# Additional context +You can use this space to give any other additional information that you think would be useful to solve the issue. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..1d28da4 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,24 @@ +# Description + +Please include a summary of the changes and the related issue (if applicable). Please also include relevant motivation and context. List any dependencies that are required for this change. + +Fixes # (issue) + +Additional dependencies introduced. +- Dependency 1 +- Dependency 2 + +## Type of change + +Please select what type of change this is. + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature + - [ ] Non-breaking change which adds functionality + - [ ] Breaking change fix or feature that would cause existing functionality to not work as expected + +# Checklist: + +- [ ] My code follows the style guidelines of this project +- [ ] I have made corresponding changes to the documentation +- [ ] I have added tests that prove my fix is effective or that my feature works \ No newline at end of file diff --git a/.github/workflows/AutomatedTests_linux.yml b/.github/workflows/AutomatedTests_linux.yml new file mode 100644 index 0000000..e0d1311 --- /dev/null +++ b/.github/workflows/AutomatedTests_linux.yml @@ -0,0 +1,58 @@ +# This is a basic workflow to help you get started with Actions + +name: testing Linux + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the master branch + pull_request: + branches: [ main ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + TestBuild: + # The type of runner that the job will run on + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12", "3.13"] + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v4 + + # Install python + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + # set up an headless display + - name: Setup headless display + if: runner.os == 'Linux' + uses: pyvista/setup-headless-display-action@v3 + + # Install the package + - name: Install the package + run: | + python -m pip install --upgrade pip + python -m pip install -e .[dev] + + # Run pytest + - name: Testing + run: | + pytest --cov=src/em_interp --cov-config=".coveragerc" --cov-report xml + + - name: Upload coverage to Codecov + # do it only once for python 3.10 + if: matrix.python-version == '3.10' + uses: codecov/codecov-action@v4 + with: + verbose: true + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/AutomatedTests_win.yml b/.github/workflows/AutomatedTests_win.yml new file mode 100644 index 0000000..c04921c --- /dev/null +++ b/.github/workflows/AutomatedTests_win.yml @@ -0,0 +1,46 @@ +# This is a basic workflow to help you get started with Actions + +name: testing Windows + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the master branch + pull_request: + branches: [main] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + TestBuild: + # The type of runner that the job will run on + runs-on: windows-latest + env: + MPLBACKEND: Agg # To avoid issues with matplotlib on headless systems (TLC error) + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12", "3.13"] + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v4 + + # Install python + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + # Install the package + - name: Install the package + run: | + python -m pip install --upgrade pip + python -m pip install .[dev] + + # Run pytest + - name: Testing + run: | + pytest diff --git a/.github/workflows/build_publish.yml b/.github/workflows/build_publish.yml new file mode 100644 index 0000000..c8cfcad --- /dev/null +++ b/.github/workflows/build_publish.yml @@ -0,0 +1,31 @@ +# GitHub recommends pinning actions to a commit SHA. +# To get a newer version, you will need to update the SHA. +# You can also reference a tag or branch, but the action may change without warning. + +name: Upload Python Package + +on: + release: + types: [published] + +jobs: + deploy: + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 + # with: + # repository-url: https://test.pypi.org/legacy/ \ No newline at end of file diff --git a/.gitignore b/.gitignore index 43bd423..18f61f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .vscode **/__pycache__ .pytest_cache/** -**/em_interpolator.egg-info \ No newline at end of file +**/em_interpolator.egg-info +src/_version.py \ No newline at end of file diff --git a/README.md b/README.md index 7c436ec..17dbc23 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,22 @@ +[![Testing windows](https://github.com/Fusion4Energy/EM-interpolator/actions/workflows/AutomatedTests_win.yml/badge.svg?branch=main)](https://github.com/Fusion4Energy/EM-interpolator/actions/workflows/AutomatedTests_win.yml) +[![Testing linux](https://github.com/Fusion4Energy/EM-interpolator/actions/workflows/AutomatedTests_linux.yml/badge.svg?branch=main)](https://github.com/Fusion4Energy/EM-interpolator/actions/workflows/AutomatedTests_linux.yml) +[![PyPi version](https://badgen.net/pypi/v/em-interpolator/)](https://pypi.org/project/em-interpolator) +[![codecov](https://codecov.io/gh/Fusion4Energy/EM-interpolator/graph/badge.svg?token=P4A85K0ACG)](https://codecov.io/gh/Fusion4Energy/EM-interpolator) + # EM forces interpolator ## Quickstart -First, after downloading the package, install it using: +``em-interpolator`` is now on PyPi. You can simply install it using: + +``` +pip install em-interpolator +``` + +and upgraded it to the latest version with ``` -pip install . +pip install --upgrade em-interpolator ``` After that, start the GUI using: diff --git a/pyproject.toml b/pyproject.toml index 39ecd03..de7aa2a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,8 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "em-interpolator" license = { file = "LICENSE" } -# dynamic = ["version"] -version = "0.0.1" +dynamic = ["version"] authors = [ { name = "F4E mechanical team", email = "davide.laghi@f4e.europa.eu" }, ] @@ -27,16 +26,16 @@ dependencies = [ [project.optional-dependencies] dev = ["pytest", "pytest-cov", "ruff"] -# [project.urls] -# Homepage = "https://github.com/fusion4energy" -# Repository = "https://github.com/Fusion4Energy/F4Enix" -# Documentation = "https://f4enix.readthedocs.io/en/latest/" +[project.urls] +Homepage = "https://github.com/Fusion4Energy" +Repository = "https://github.com/Fusion4Energy/EM-interpolator" +Documentation = "https://github.com/Fusion4Energy/EM-interpolator" -# [tool.setuptools_scm] -# write_to = "src/_version.py" +[tool.setuptools_scm] +write_to = "src/_version.py" [tool.setuptools] package-dir = { "" = "src" } [tool.setuptools.package-data] -"f4enix" = ["**/*.xlsx", "**/*.txt", "**/*.csv"] +"em_interp" = ["**/*.xlsx", "**/*.txt", "**/*.csv"]