mirror of
https://github.com/nqrduck/nqrduck-spectrometer-simulator.git
synced 2025-01-02 12:48:09 +00:00
Initial deployment to PyPi.
This commit is contained in:
parent
61dec3893a
commit
8bd826c49f
7 changed files with 85 additions and 12 deletions
44
.github/workflows/python-publish.yml
vendored
Normal file
44
.github/workflows/python-publish.yml
vendored
Normal 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 }}
|
|
@ -1,4 +1,6 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
### Version 0.0.3 (23-04-2024)
|
||||||
|
- Initial deployment of the Spectrometer Simulator to PyPi
|
||||||
|
|
||||||
### Version 0.0.2 (15-04-2024)
|
### Version 0.0.2 (15-04-2024)
|
||||||
- Initial release
|
- Initial release
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2023 Julia Pfitzer
|
Copyright (c) 2023 jupfi
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
@ -18,11 +18,16 @@ Ideally you should install the module in a virtual environment. You can create a
|
||||||
python -m venv nqrduck
|
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
|
```bash
|
||||||
pip install .
|
pip install .
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Alternatively you can install the module via PyPI:
|
||||||
|
```bash
|
||||||
|
pip install nqrduck-spectrometer-simulator
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
The pulse sequence is graphically programmed using the [nqrduck-pulseprogrammer](htpps://github.com/nqrduck-pulseprogrammer) within the NQRduck program under the 'Spectrometer' tab.
|
The pulse sequence is graphically programmed using the [nqrduck-pulseprogrammer](htpps://github.com/nqrduck-pulseprogrammer) within the NQRduck program under the 'Spectrometer' tab.
|
||||||
|
|
||||||
|
|
|
@ -7,15 +7,15 @@ allow-direct-references = true
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "nqrduck-spectrometer-simulator"
|
name = "nqrduck-spectrometer-simulator"
|
||||||
version = "0.0.2"
|
version = "0.0.3"
|
||||||
authors = [
|
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."
|
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"
|
readme = "README.md"
|
||||||
license = { file="LICENSE" }
|
license = { file="LICENSE" }
|
||||||
requires-python = ">=3.8"
|
requires-python = ">=3.10"
|
||||||
|
|
||||||
classifiers = [
|
classifiers = [
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
|
@ -27,8 +27,33 @@ dependencies = [
|
||||||
"nqrduck-spectrometer",
|
"nqrduck-spectrometer",
|
||||||
"pyqt6",
|
"pyqt6",
|
||||||
"numpy",
|
"numpy",
|
||||||
"nqr_blochsimulator@git+https://github.com/jupfi/nqr-blochsimulator.git",
|
"nqr-blochsimulator",
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.entry-points."nqrduck"]
|
[project.entry-points."nqrduck"]
|
||||||
"nqrduck-spectrometer-simulator" = "nqrduck_spectrometer_simulator.simulator:Simulator"
|
"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"]
|
|
@ -269,10 +269,9 @@ class SimulatorController(BaseSpectrometerController):
|
||||||
def translate_rx_event(self) -> tuple:
|
def translate_rx_event(self) -> tuple:
|
||||||
"""This method translates the RX event of the pulse sequence to the limr object.
|
"""This method translates the RX event of the pulse sequence to the limr object.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Returns:
|
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.
|
# 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
|
events = self.module.model.pulse_programmer.model.pulse_sequence.events
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,6 @@ from nqrduck_spectrometer.pulseparameters import TXPulse, RXReadout
|
||||||
from nqrduck_spectrometer.settings import (
|
from nqrduck_spectrometer.settings import (
|
||||||
FloatSetting,
|
FloatSetting,
|
||||||
IntSetting,
|
IntSetting,
|
||||||
BooleanSetting,
|
|
||||||
SelectionSetting,
|
|
||||||
StringSetting,
|
StringSetting,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue