Skip to content

Initial import: extract hardware from pqn-stack#1

Merged
marcosfrenkel merged 94 commits into
masterfrom
initial-import
Apr 20, 2026
Merged

Initial import: extract hardware from pqn-stack#1
marcosfrenkel merged 94 commits into
masterfrom
initial-import

Conversation

@marcosfrenkel
Copy link
Copy Markdown
Collaborator

Summary

Initial import of the hardware-control half of pqn-stack into this repository, with commit history preserved via git filter-repo.

The FastAPI Node app stays in pqn-stack (which will be renamed to pqn-node in a follow-up PR) and will depend on this package via a git-URL pin.

What's in the history

  • 87 filtered pqn-stack commits that ever touched src/pqnstack/{base,network,pqn,cli.py,constants.py}, the messaging/network tests, example configs, and dev scripts. Commits that only touched src/pqnstack/app/ were dropped. git log --follow traces every surviving file back to its original creation.
  • 5 follow-up commits on this branch:
    1. Rename pqnstackpqn_hardware (directory + all imports + string references).
    2. Trim app-side commands (toggle-game, daily-report) out of cli.py.
    3. Rewrite pyproject.toml: distribution pqn-hardware, drop fastapi/httpx/pydantic-settings/tomli-w, entry point pqn-hw.
    4. Rewrite README.md for pqn-hardware.
    5. Regenerate uv.lock.
  • One merge commit joining the README-only master of this repo with the filtered history so GitHub would accept the PR (unrelated-histories merge).

Known quirks / follow-ups

  • src/pqn_hardware/pqn/ contains drivers/ and protocols/ — the inner pqn/ is redundant given the package is already named pqn_hardware. Left as-is here to keep the rename diff small; worth flattening in a follow-up PR.
  • Config TOML files now reference names like pqn_hardware-router / pqn_hardware-provider (mechanical sed rewrite). Cosmetic; can be renamed in a follow-up.
  • tests/pytest/test_internal_network.py and the scripts http_server, coincidence_gui have a couple of pre-existing import bugs (e.g. pqnstack.base.driver.rotator, pqnstack.base.instruments) that predate this split and were not touched here.

Test plan

  • uv sync succeeds
  • python -c "from pqn_hardware.network.packet import Packet; from pqn_hardware.base.instrument import Instrument; from pqn_hardware.constants import HV_BASIS" — imports resolve
  • pqn-hw --help shows only start-provider and start-router
  • pytest tests/pytest/test_placeholder.py passes
  • Reviewer: spot-check git log --follow src/pqn_hardware/network/packet.py resolves back through the original rename
  • Reviewer: skim pyproject.toml to confirm no app-only deps survive

🤖 Generated with Claude Code

nunezco2 and others added 30 commits August 14, 2024 11:35
* Use src layout

* Rename doc/ -> docs/

Consistency with other pluralized directories (e.g., tests, configs)
* format: apply ruff format and automatic lint fixes

* format: suffix Error to custom error class names
* Added Ruff linter to the workflow

* triggering github actions on my branch

* Added mypy as dependency and check

* Adding test skeleton and pytests

* missed the pdm part in the yml

* Activating everything and cleaning up name on trigger branch
* Fixed workflow file

* Don't rely on copilot for everything...

* Removed extra testing branch
* Fixed all mypy errors

* adding DS_Store to gitignore

* I forgot about PDM errors, thank you github actions!
* Fixed all mypy errors

* adding DS_Store to gitignore

* I forgot about PDM errors, thank you github actions!

* Changed directory test to tests to keep consistency with other plural folder names.

* Added new device info from rotator branch into current driver file

* Added jupyternotebooks as a dev requirement, added instantiation aspect in the testing notebook. Did some modification to base driver

* Added Parameter objects

* Added type checking for Parameter setters

* Added Properties

* Added validation to implementations of DeviceDriver

* Deleting testing notebook

* Implemented basic feedback

* Initial driver v3

* Some fixes to base driver and added real rotator implementation

* deleted old version of BaseDriver + mypy and ruff checks

* made parameters a set

* More mypy and ruff checks

* Fixed final mypy checks

* Implemented conditional changes

---------

Co-authored-by: Kriti1105 <kritips2@illinois.edu>
* Added basic skeleton for messaging

* Changing structure to using match-case

* Implemented factory function feedback

* Cleaned up some of the sending code and added error packet

* mypy and ruff checks

* forgot testing scripts

* Implemented more feedback

* Fixed merge error and implemented small rotator feedback

* use refactoring tools, don't just change stuff
* Bump dependencies, update config for ruff and mypy

* Simplify ruff linting rules

* Adjust mypy config

* Use to uv for project management

* Fix some mypy errors

* Apply manual ruff fixes

* Use pytest-cov for code coverage

* Refresh ci workflow for uv

* Add package build system and script entry point
* Add new device info from rotator branch into current driver file

* Add Parameter objects

* Add type checking for Parameter setters

* Add Properties

* Add validation to implementations of DeviceDriver

* You can now create (a useless for now) InstrumentProxy

* Implement executing remote operations

* You can now read and set remote parameters
---------

Co-authored-by: Benjamin Nussbaum <bn9@illinois.edu>
Co-authored-by: Benjamin-Nussbaum <bn9@illinois.edu>
- Polarimeter device driver
- Network wrapper for polarimeter device driver
- Script to run local webserver for live web app

---------

Co-authored-by: tonypark0914 <60662735+tonypark0914@users.noreply.github.com>
Co-authored-by: Benjamin Nussbaum <50522055+Benjamin-Nussbaum@users.noreply.github.com>
v0l01 and others added 27 commits March 4, 2026 08:50
This repository is being split off from pqn-stack to isolate
the hardware-control library. The FastAPI app lives in pqn-node
and will depend on this package.

Moves src/pqnstack/ to src/pqn_hardware/ (git preserves --follow
history across the rename) and rewrites every `pqnstack.*`
reference (imports, config strings, provider/router names) to
`pqn_hardware.*`.

pyproject.toml, README.md, and uv.lock are rewritten in
follow-up commits.
Removes toggle-game, daily-report (run/status/schedule/unschedule),
and their imports from pqn_hardware.app — those responsibilities
live in pqn-node now. Keeps start-provider and start-router, which
are the hardware-side entry points.
- Distribution name: pqn-hardware
- Description updated
- Drops app-only deps (fastapi, httpx, pydantic-settings, tomli-w)
- Entry point: pqn-hw = pqn_hardware.cli:app
Hardware-focused overview, install/quick-start instructions, and a
note describing how pqn-node depends on this package via a git URL.
Links the filtered pqn-stack history to the README-only master
of this new repo so a PR can be opened. Without this merge GitHub
refuses the PR: 'branch has no history in common with master'.

# Conflicts:
#	README.md
@marcosfrenkel marcosfrenkel merged commit 093bd0b into master Apr 20, 2026
6 checks passed
@marcosfrenkel marcosfrenkel deleted the initial-import branch April 20, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants