Initial deployment to PyPi.

This commit is contained in:
jupfi 2024-04-23 18:30:02 +02:00
parent 61dec3893a
commit 8bd826c49f
7 changed files with 85 additions and 12 deletions

44
.github/workflows/python-publish.yml vendored Normal file
View file

@ -0,0 +1,44 @@
name: Build, Test, and Upload Python Package
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
permissions:
contents: read
jobs:
# test:
# uses: ./.github/workflows/ubuntu-python-package.yml # use the callable tests job to run tests
deploy:
runs-on: ubuntu-latest
# needs: [test]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
sudo apt-get update
python -m pip install --upgrade pip
- name: Publish to PyPI
run: |
python -m venv venv
. ./venv/bin/activate
pip install -U twine build
python -m build .
python -m twine upload --repository pypi --username __token__ --password ${{ secrets.PYPI }} dist/*
env:
PYPI: ${{ secrets.PYPI }}

View file

@ -1,4 +1,6 @@
# Changelog
### Version 0.0.3 (23-04-2024)
- Initial deployment of the Spectrometer Simulator to PyPi
### Version 0.0.2 (15-04-2024)
- Initial release

View file

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2023 Julia Pfitzer
Copyright (c) 2023 jupfi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -18,11 +18,16 @@ Ideally you should install the module in a virtual environment. You can create a
python -m venv nqrduck
```
You can install this module and the dependencies by running the following command in the terminal:
You can install this module and the dependencies by running the following command in the terminal after cloning the repository and navigating to the root directory of the project:
```bash
pip install .
```
Alternatively you can install the module via PyPI:
```bash
pip install nqrduck-spectrometer-simulator
```
## Usage
The pulse sequence is graphically programmed using the [nqrduck-pulseprogrammer](htpps://github.com/nqrduck-pulseprogrammer) within the NQRduck program under the 'Spectrometer' tab.

View file

@ -7,15 +7,15 @@ allow-direct-references = true
[project]
name = "nqrduck-spectrometer-simulator"
version = "0.0.2"
version = "0.0.3"
authors = [
{ name="Julia Pfitzer", email="git@jupfi.me" },
{ name="jupfi", email="support@nqrduck.cool" },
]
description = "A submodule for the nqrduck-spectrometer module which implements the functionality of a NQR bloch simulator. This should enable easy simulation of NQR experiments."
readme = "README.md"
license = { file="LICENSE" }
requires-python = ">=3.8"
requires-python = ">=3.10"
classifiers = [
"Programming Language :: Python :: 3",
@ -27,8 +27,33 @@ dependencies = [
"nqrduck-spectrometer",
"pyqt6",
"numpy",
"nqr_blochsimulator@git+https://github.com/jupfi/nqr-blochsimulator.git",
"nqr-blochsimulator",
]
[project.entry-points."nqrduck"]
"nqrduck-spectrometer-simulator" = "nqrduck_spectrometer_simulator.simulator:Simulator"
[tool.ruff]
exclude = [
"widget.py",
]
[tool.ruff.lint]
extend-select = [
"UP", # pyupgrade
"D", # pydocstyle
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[project.urls]
"Homepage" = "https://nqrduck.cool"
"Bug Tracker" = "https://github.com/nqrduck/nqrduck-spectrometer-simulator/issues"
"Source Code" = "https://github.com/nqrduck/nqrduck-spectrometer-simulator"
[tool.hatch.build.targets.wheel]
packages = ["src/nqrduck_spectrometer_simulator"]

View file

@ -269,10 +269,9 @@ class SimulatorController(BaseSpectrometerController):
def translate_rx_event(self) -> tuple:
"""This method translates the RX event of the pulse sequence to the limr object.
Returns:
tuple: A tuple containing the start and stop time of the RX event in µs"""
tuple: A tuple containing the start and stop time of the RX event in µs
"""
# This is a correction factor for the RX event. The offset of the first pulse is 2.2µs longer than from the specified samples.
events = self.module.model.pulse_programmer.model.pulse_sequence.events

View file

@ -4,8 +4,6 @@ from nqrduck_spectrometer.pulseparameters import TXPulse, RXReadout
from nqrduck_spectrometer.settings import (
FloatSetting,
IntSetting,
BooleanSetting,
SelectionSetting,
StringSetting,
)