pyobs-flipro 1.2.0__tar.gz → 2.0.0.dev2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,26 @@
1
+ name: Publish package to PyPI
2
+ on:
3
+ push:
4
+ tags:
5
+ - 'v*'
6
+ jobs:
7
+ build-n-publish:
8
+ name: Build and publish package to PyPI
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - name: Check out repository code
12
+ uses: actions/checkout@v4
13
+
14
+ - name: Set up Python
15
+ uses: astral-sh/setup-uv@v5
16
+ with:
17
+ enable-cache: true
18
+ python-version: "3.11"
19
+
20
+ - name: Build
21
+ run: uv build --sdist
22
+
23
+ - name: Publish
24
+ env:
25
+ PYPI_TOKEN: ${{ secrets.pypi_password }}
26
+ run: uv publish --token $PYPI_TOKEN
@@ -0,0 +1,23 @@
1
+ name: ruff
2
+ on: push
3
+
4
+ jobs:
5
+ ruff:
6
+ runs-on: ubuntu-latest
7
+ timeout-minutes: 10
8
+
9
+ steps:
10
+ - name: Check out repository code
11
+ uses: actions/checkout@v4
12
+
13
+ - name: Set up Python
14
+ uses: astral-sh/setup-uv@v5
15
+ with:
16
+ enable-cache: true
17
+ python-version: "3.13"
18
+
19
+ - name: Install packages
20
+ run: uv sync --all-extras --dev
21
+
22
+ - name: Run ruff
23
+ run: uv run ruff check pyobs_flipro/
@@ -0,0 +1,15 @@
1
+ repos:
2
+ # Using this mirror lets us use mypyc-compiled black, which is about 2x faster
3
+ - repo: https://github.com/psf/black-pre-commit-mirror
4
+ rev: 25.1.0
5
+ hooks:
6
+ - id: black
7
+ # It is recommended to specify the latest version of Python
8
+ # supported by your project here, or alternatively use
9
+ # pre-commit's default_language_version, see
10
+ # https://pre-commit.com/#top_level-default_language_version
11
+ language_version: python3.11
12
+ - repo: https://github.com/astral-sh/ruff-pre-commit
13
+ rev: v0.9.0
14
+ hooks:
15
+ - id: ruff
@@ -0,0 +1,14 @@
1
+ version: 2
2
+
3
+ build:
4
+ os: ubuntu-20.04
5
+ tools:
6
+ python: "3.9"
7
+
8
+ sphinx:
9
+ configuration: docs/source/conf.py
10
+
11
+ python:
12
+ install:
13
+ - method: pip
14
+ path: .
@@ -0,0 +1,72 @@
1
+ cmake_minimum_required(VERSION 3.21)
2
+ project(pyobs_flipro LANGUAGES C)
3
+
4
+ # --- Ensure we use the build environment Python ---
5
+ set(Python3_FIND_VIRTUALENV ONLY)
6
+ set(Python3_FIND_STRATEGY LOCATION)
7
+ find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module)
8
+
9
+ # --- Paths ---
10
+ set(PYX_FILE "${CMAKE_CURRENT_SOURCE_DIR}/pyobs_flipro/fliprodriver.pyx")
11
+ set(C_FILE "${CMAKE_CURRENT_BINARY_DIR}/fliprodriver.c")
12
+
13
+ # --- Get NumPy include dir ---
14
+ execute_process(
15
+ COMMAND "${Python3_EXECUTABLE}" -c "import numpy; print(numpy.get_include())"
16
+ OUTPUT_VARIABLE NUMPY_INCLUDE_DIR
17
+ OUTPUT_STRIP_TRAILING_WHITESPACE
18
+ )
19
+
20
+ # --- Run Cython ---
21
+ add_custom_command(
22
+ OUTPUT ${C_FILE}
23
+ COMMAND "${Python3_EXECUTABLE}" -m cython
24
+ ${PYX_FILE}
25
+ --output-file ${C_FILE}
26
+ -I "${CMAKE_CURRENT_SOURCE_DIR}/pyobs_flipro"
27
+ DEPENDS ${PYX_FILE} "${CMAKE_CURRENT_SOURCE_DIR}/pyobs_flipro/libflipro.pxd"
28
+ COMMENT "Running Cython on fliprodriver.pyx"
29
+ )
30
+
31
+ # --- Build extension module ---
32
+ add_library(fliprodriver MODULE ${C_FILE})
33
+ target_include_directories(fliprodriver PRIVATE
34
+ ${Python3_INCLUDE_DIRS}
35
+ ${NUMPY_INCLUDE_DIR}
36
+ ${CMAKE_CURRENT_SOURCE_DIR}/lib/
37
+ )
38
+
39
+ # --- Correct Python module naming ---
40
+ execute_process(
41
+ COMMAND "${Python3_EXECUTABLE}" -c
42
+ "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))"
43
+ OUTPUT_VARIABLE PY_EXT_SUFFIX
44
+ OUTPUT_STRIP_TRAILING_WHITESPACE
45
+ )
46
+ set_target_properties(fliprodriver PROPERTIES
47
+ PREFIX ""
48
+ OUTPUT_NAME "fliprodriver"
49
+ SUFFIX "${PY_EXT_SUFFIX}"
50
+ POSITION_INDEPENDENT_CODE ON
51
+ INSTALL_RPATH "$ORIGIN"
52
+ BUILD_WITH_INSTALL_RPATH ON
53
+ )
54
+ message(STATUS "ext: ${PY_EXT_SUFFIX}")
55
+
56
+ # --- Bundled FLIPRO libraries (pre-compiled, shipped in lib/) ---
57
+ set(FLIPRO_LIB "${CMAKE_CURRENT_SOURCE_DIR}/lib/liblibflipro.so")
58
+ set(FLIALGO_LIB "${CMAKE_CURRENT_SOURCE_DIR}/lib/liblibflialgo.so")
59
+ target_link_libraries(fliprodriver PRIVATE ${FLIPRO_LIB} ${FLIALGO_LIB})
60
+
61
+ # --- System libraries ---
62
+ find_library(CFITSIO_LIB cfitsio REQUIRED)
63
+ find_library(USB_LIB usb-1.0 REQUIRED)
64
+ target_link_libraries(fliprodriver PRIVATE ${CFITSIO_LIB} ${USB_LIB})
65
+
66
+ # --- Install extension and bundled .so files into package ---
67
+ install(TARGETS fliprodriver
68
+ LIBRARY DESTINATION ${SKBUILD_PROJECT_NAME}
69
+ )
70
+ install(FILES ${FLIPRO_LIB} ${FLIALGO_LIB}
71
+ DESTINATION ${SKBUILD_PROJECT_NAME}
72
+ )
@@ -0,0 +1,14 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyobs-flipro
3
+ Version: 2.0.0.dev2
4
+ Summary: pyobs module for FLIPRO cameras
5
+ Author-Email: Tim-Oliver Husser <thusser@uni-goettingen.de>
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.11
8
+ Requires-Dist: astropy<8,>=7.0.1
9
+ Requires-Dist: numpy<3,>=2.2.5
10
+ Requires-Dist: pyobs-core<3,>=2.0.0.dev6
11
+ Provides-Extra: gui
12
+ Requires-Dist: PySide6>=6.7; extra == "gui"
13
+ Requires-Dist: qasync>=0.27; extra == "gui"
14
+
@@ -0,0 +1,30 @@
1
+ FLIPRO module for *pyobs*
2
+ =========================
3
+
4
+ Install *pyobs-fli*
5
+ -------------------
6
+ Use pip
7
+
8
+ pip install pyobs-flipro
9
+
10
+
11
+ Configuration
12
+ -------------
13
+ The *FliProCamera* class is derived from *BaseCamera* (see *pyobs* documentation) and adds a single new parameter:
14
+
15
+ setpoint:
16
+ The initial setpoint in degrees Celsius for the cooling of the camera.
17
+
18
+ The class works fine with its default parameters, so a basic module configuration would look like this:
19
+
20
+ module:
21
+ class: pyobs_flipro.FliProCamera
22
+ name: FLIPRO camera
23
+
24
+ Dependencies
25
+ ------------
26
+ * **pyobs** for the core funcionality. It is not included in the *requirements.txt*, so needs to be installed
27
+ separately.
28
+ * [Cython](https://cython.org/) for wrapping the SBIG Universal Driver.
29
+ * [Astropy](http://www.astropy.org/) for FITS file handling.
30
+ * [NumPy](http://www.numpy.org/) for array handling.