Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: lobis/hvps
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.0.5
Choose a base ref
...
head repository: lobis/hvps
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Jun 29, 2023

  1. attempt to fix npm publish

    lobis committed Jun 29, 2023
    Copy the full SHA
    548903e View commit details
  2. automate version tagging

    lobis committed Jun 29, 2023
    Copy the full SHA
    874ddcc View commit details
  3. fix sed

    lobis committed Jun 29, 2023
    Copy the full SHA
    ce09265 View commit details
  4. checkout to main in action

    lobis committed Jun 29, 2023
    Copy the full SHA
    6da8c83 View commit details
  5. attempt to fix auto-version

    lobis committed Jun 29, 2023
    Copy the full SHA
    15c33af View commit details
  6. use commit -m

    lobis committed Jun 29, 2023
    Copy the full SHA
    4409d50 View commit details
  7. attempt to fix auto-version

    lobis committed Jun 29, 2023
    Copy the full SHA
    849cda6 View commit details
  8. use my git user for push

    lobis committed Jun 29, 2023
    Copy the full SHA
    481ece0 View commit details
  9. update my user name

    lobis committed Jun 29, 2023
    Copy the full SHA
    ec2fd42 View commit details
  10. Update version

    lobis committed Jun 29, 2023
    Copy the full SHA
    53747f3 View commit details
  11. Copy the full SHA
    82cc798 View commit details
  12. Copy the full SHA
    c3ec11d View commit details
  13. update token

    lobis committed Jun 29, 2023
    Copy the full SHA
    208dc0d View commit details
  14. add head ref

    lobis committed Jun 29, 2023
    Copy the full SHA
    247b94a View commit details
  15. fix invalid head

    lobis committed Jun 29, 2023
    Copy the full SHA
    cc4c0f3 View commit details
  16. use main as head

    lobis committed Jun 29, 2023
    Copy the full SHA
    6cba04c View commit details
  17. using my email to push

    lobis committed Jun 29, 2023
    Copy the full SHA
    09456f7 View commit details
  18. Update version to 0.0.19

    lobis committed Jun 29, 2023
    Copy the full SHA
    63383ef View commit details
  19. use cache instead of checkout

    lobis committed Jun 29, 2023
    Copy the full SHA
    ca606a2 View commit details
  20. Merge remote-tracking branch 'origin/main'

    * origin/main:
      Update version to 0.0.19
    lobis committed Jun 29, 2023
    Copy the full SHA
    1f77410 View commit details
  21. remove bad dependency

    lobis committed Jun 29, 2023
    Copy the full SHA
    730e028 View commit details
  22. Update version to 0.0.21

    lobis committed Jun 29, 2023
    Copy the full SHA
    28e8899 View commit details

Commits on Jun 30, 2023

  1. Logging (#25)

    * logging, refactor caen structure
    
    * add logging to isec
    
    * add logging accessor
    lobis authored Jun 30, 2023
    Copy the full SHA
    f5a09ac View commit details
  2. add more checks to pre-commit

    lobis committed Jun 30, 2023
    Copy the full SHA
    8388e9e View commit details
  3. working nodejs cli

    lobis committed Jun 30, 2023
    Copy the full SHA
    789fdfc View commit details

Commits on Jul 3, 2023

  1. update README.md

    lobis committed Jul 3, 2023
    Copy the full SHA
    8fee1f7 View commit details
  2. Include logging in tests (#27)

    * improved logging
    
    * include logging in test
    lobis authored Jul 3, 2023
    Copy the full SHA
    9373fe3 View commit details
  3. add missing logger

    lobis committed Jul 3, 2023
    Copy the full SHA
    94d1951 View commit details
  4. explicit arguments

    lobis committed Jul 3, 2023
    Copy the full SHA
    29c3f79 View commit details
  5. Copy the full SHA
    be22e94 View commit details
  6. test iseg devices

    lobis committed Jul 3, 2023
    Copy the full SHA
    a6ca02c View commit details
  7. fix typing in older python

    lobis committed Jul 3, 2023
    Copy the full SHA
    4b76b8f View commit details
  8. [pre-commit.ci] pre-commit autoupdate (#28)

    updates:
    - https://github.com/charliermarsh/ruff-pre-commithttps://github.com/astral-sh/ruff-pre-commit
    - [github.com/astral-sh/ruff-pre-commit: v0.0.275 → v0.0.276](astral-sh/ruff-pre-commit@v0.0.275...v0.0.276)
    
    Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
    pre-commit-ci[bot] authored Jul 3, 2023
    Copy the full SHA
    7352ce3 View commit details

Commits on Jul 4, 2023

  1. Nodered node (#24)

    * working on nodered node
    
    * working on nodered node
    
    * automatically sync version between python and js
    
    * add ruff cache to .gitignore
    
    * add check for nodejs and python version sync
    
    * add additional check for version matching
    
    * refactor bindings into two projects: js bindings and nodered module
    
    * refactor bindings into two projects: js bindings and nodered module
    
    * working on nodered node
    
    * automatically sync version between python and js
    
    * add ruff cache to .gitignore
    
    * add check for nodejs and python version sync
    
    * add additional check for version matching
    
    * fix bad path
    
    * publish node-red package to npm
    lobis authored Jul 4, 2023
    Copy the full SHA
    68628ff View commit details
  2. Update version to 0.0.22

    lobis committed Jul 4, 2023
    Copy the full SHA
    a464a5b View commit details
  3. update sed

    lobis committed Jul 4, 2023
    Copy the full SHA
    aa82e33 View commit details
  4. Update version to 0.0.23

    lobis committed Jul 4, 2023
    Copy the full SHA
    69df8de View commit details
  5. add cache-dependency-path

    lobis committed Jul 4, 2023
    Copy the full SHA
    0b29f3d View commit details
  6. Update version to 0.0.24

    lobis committed Jul 4, 2023
    Copy the full SHA
    8eaec3e View commit details
  7. Merge remote-tracking branch 'origin/main'

    * origin/main:
      Update version to 0.0.24
      Update version to 0.0.23
    lobis committed Jul 4, 2023
    Copy the full SHA
    db59aeb View commit details
  8. Update version to 0.0.25

    lobis committed Jul 4, 2023
    Copy the full SHA
    3588de4 View commit details
  9. update cache-dependency-path

    lobis committed Jul 4, 2023
    Copy the full SHA
    71a1169 View commit details
  10. Merge remote-tracking branch 'origin/main'

    * origin/main:
      Update version to 0.0.25
    lobis committed Jul 4, 2023
    Copy the full SHA
    b400b16 View commit details
  11. Update version to 0.0.26

    lobis committed Jul 4, 2023
    Copy the full SHA
    a9d9ecb View commit details
  12. fix dependency

    lobis committed Jul 4, 2023
    Copy the full SHA
    b0efeca View commit details
  13. Merge remote-tracking branch 'origin/main'

    * origin/main:
      Update version to 0.0.26
    lobis committed Jul 4, 2023
    Copy the full SHA
    7fb5aa2 View commit details
  14. Update version to 0.0.27

    lobis committed Jul 4, 2023
    Copy the full SHA
    f9dffcc View commit details
  15. fix bad package.json

    lobis committed Jul 4, 2023
    Copy the full SHA
    849e5da View commit details
  16. Update version to 0.0.28

    lobis committed Jul 4, 2023
    Copy the full SHA
    19b80fc View commit details
  17. fix bad package.json

    lobis committed Jul 4, 2023
    Copy the full SHA
    741ec34 View commit details
Showing with 5,923 additions and 2,327 deletions.
  1. +44 −0 .all-contributorsrc
  2. +10 −0 .github/dependabot.yml
  3. +17 −12 .github/workflows/build-test.yml
  4. +113 −29 .github/workflows/publish.yml
  5. +14 −9 .pre-commit-config.yaml
  6. +115 −33 README.md
  7. +0 −25 bindings/nodejs/cli.js
  8. +34 −0 bindings/nodejs/hvps/cli.js
  9. 0 bindings/nodejs/{ → hvps}/index.js
  10. +70 −70 bindings/nodejs/{ → hvps}/package-lock.json
  11. +19 −14 bindings/nodejs/{ → hvps}/package.json
  12. 0 bindings/nodejs/{ → nodered}/README.md
  13. +129 −0 bindings/nodejs/nodered/hvps-nodered.html
  14. +56 −0 bindings/nodejs/nodered/hvps-nodered.js
  15. +188 −0 bindings/nodejs/nodered/package-lock.json
  16. +27 −0 bindings/nodejs/nodered/package.json
  17. +54 −0 gui/CAEN-N1471H/README.md
  18. +163 −0 gui/CAEN-N1471H/caen_simulator.py
  19. +613 −0 gui/CAEN-N1471H/gui.py
  20. +2 −0 gui/README.md
  21. +261 −92 src/hvps/__main__.py
  22. +38 −26 src/hvps/commands/caen/__init__.py
  23. +391 −74 src/hvps/commands/caen/channel.py
  24. +116 −21 src/hvps/commands/caen/module.py
  25. +37 −34 src/hvps/commands/iseg/__init__.py
  26. +470 −69 src/hvps/commands/iseg/channel.py
  27. +425 −57 src/hvps/commands/iseg/module.py
  28. +21 −1 src/hvps/devices/caen/caen.py
  29. +138 −202 src/hvps/devices/caen/channel.py
  30. +79 −110 src/hvps/devices/caen/module.py
  31. +12 −4 src/hvps/devices/channel.py
  32. +139 −33 src/hvps/devices/hvps.py
  33. +345 −352 src/hvps/devices/iseg/channel.py
  34. +28 −1 src/hvps/devices/iseg/iseg.py
  35. +358 −261 src/hvps/devices/iseg/module.py
  36. +0 −651 src/hvps/devices/iseg/output.py
  37. +0 −19 src/hvps/devices/iseg/script.py
  38. +23 −8 src/hvps/devices/module.py
  39. +3 −1 src/hvps/utils/__init__.py
  40. +138 −1 src/hvps/utils/utils.py
  41. +1 −1 src/hvps/version.py
  42. +13 −19 tests/test_caen_commands.py
  43. +34 −0 tests/test_caen_devices.py
  44. +26 −9 tests/{test_caen_serial.py → test_caen_serial_mon.py}
  45. +114 −0 tests/test_caen_serial_set.py
  46. +238 −38 tests/test_cli.py
  47. +77 −0 tests/test_cli_serial.py
  48. +14 −43 tests/test_iseg_commands.py
  49. +36 −0 tests/test_iseg_devices.py
  50. +31 −7 tests/test_iseg_serial.py
  51. +273 −0 tests/test_iseg_serial_mon.py
  52. +245 −0 tests/test_iseg_serial_set.py
  53. +131 −1 tests/test_utils.py
44 changes: 44 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"commitType": "docs",
"commitConvention": "angular",
"contributors": [
{
"login": "lobis",
"name": "Luis Antonio Obis Aparicio",
"avatar_url": "https://avatars.githubusercontent.com/u/35803280?v=4",
"profile": "https://github.com/lobis",
"contributions": [
"code"
]
},
{
"login": "AlonsoDRDLV",
"name": "AlonsoDRDLV",
"avatar_url": "https://avatars.githubusercontent.com/u/71894461?v=4",
"profile": "https://github.com/AlonsoDRDLV",
"contributions": [
"code"
]
},
{
"login": "jherkenhoff",
"name": "jherkenhoff",
"avatar_url": "https://avatars.githubusercontent.com/u/22686781?v=4",
"profile": "https://github.com/jherkenhoff",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
"skipCi": true,
"repoType": "github",
"repoHost": "https://github.com",
"projectName": "hvps",
"projectOwner": "lobis"
}
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
groups:
actions:
patterns:
- '*'
29 changes: 17 additions & 12 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -16,38 +16,43 @@ jobs:
fail-fast: false
matrix:
platform: [ ubuntu-latest, windows-latest, macos-latest ]
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]

runs-on: ${{ matrix.platform }}
timeout-minutes: 20

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: "Install the package with pip"
- name: Install the package with pip
run: python -m pip install .[test]

- name: "Run pytest"
- name: Run pytest
run: python -m pytest

- name: "Run from cli"
- name: Run from cli
run: python -m hvps --version

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
cache-dependency-path: bindings/nodejs/package-lock.json
node-version: 20
cache: "npm"
cache-dependency-path: bindings/nodejs/hvps/package-lock.json

- name: "Install nodejs bindings"
- name: Install nodejs bindings
run: |
cd bindings/nodejs
cd bindings/nodejs/hvps
npm --version
node --version
npm install
node cli.js --version
- name: Check nodejs package version is in sync with python
run: |
cd bindings/nodejs/hvps/
node cli.js --version | grep $(python -m hvps --version)
142 changes: 113 additions & 29 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -5,15 +5,62 @@ on:
types: [ published ]

jobs:
update-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
token: ${{ secrets.PUSH_GITHUB_TOKEN }}

- name: Update Version to Release Tag
run: |
# Extract the release tag number
TAG=$(echo "${{ github.event.release.tag_name }}" | sed -E 's/v([0-9]+\.[0-9]+\.[0-9]+)/\1/')
# Update the version file (version.py)
sed -i "s/__version__ = \".*\"/__version__ = \"$TAG\"/" src/hvps/version.py
# Update the package.json file for bindings
sed -i "s/\"version\": \".*\"/\"version\": \"$TAG\"/" bindings/nodejs/hvps/package.json
# Update the package.json file for nodered
sed -i "s/\"version\": \".*\"/\"version\": \"$TAG\"/" bindings/nodejs/nodered/package.json
sed -i "s/\"hvps\": \".*\"/\"hvps\": \"$TAG\"/" bindings/nodejs/nodered/package.json
- name: Commit and push changes
run: |
git config --local user.name "Luis Antonio Obis Aparicio"
git config --local user.email "luis.antonio.obis@gmail.com"
git add src/hvps/version.py bindings/nodejs/hvps/package.json bindings/nodejs/nodered/package.json
git commit -m "Update version to ${{ github.event.release.tag_name }}"
git push origin HEAD:main
- name: cache source code after modification
uses: actions/cache@v4
with:
path: ${{ github.workspace }}
key: ${{ runner.os }}-src-${{ github.sha }}-${{ github.run_id}}-${{ github.run_number }}

build:
runs-on: ubuntu-latest
needs: [ update-version ]
defaults:
run:
working-directory: ${{ github.workspace }}

steps:
- uses: actions/checkout@v3
- name: restore source code from cache (contains update to version)
uses: actions/cache@v4
with:
path: ${{ github.workspace }}
key: ${{ runner.os }}-src-${{ github.sha }}-${{ github.run_id}}-${{ github.run_number }}

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: 3.12

- name: Install dependencies
run: |
@@ -32,63 +79,100 @@ jobs:
- name: Verify npm package version matches tag
run: |
python -c "import os,json;version=json.load(open('bindings/nodejs/package.json'))['version'];assert '${{ github.event.release.tag_name }}' == 'v' + version"
python -c "import os,json;version=json.load(open('bindings/nodejs/hvps/package.json'))['version'];assert '${{ github.event.release.tag_name }}' == 'v' + version"
- name: Cache dist directory
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: dist
key: ${{ runner.os }}-dist-${{ github.sha }}-${{ github.run_id}}-${{ github.run_number }}

publish-to-pypi-test:
needs: build
publish-to-pypi:
needs: [ build ]
runs-on: ubuntu-latest
steps:
- name: Restore dist from cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: dist
key: ${{ runner.os }}-dist-${{ github.sha }}-${{ github.run_id}}-${{ github.run_number }}

- name: Publish package 📦 to TEST PyPI
- name: Publish package 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TEST_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
password: ${{ secrets.PYPI_API_TOKEN }}

publish-to-pypi:
needs: [ build, publish-to-pypi-test ]
publish-bindings-to-npm:
needs: [ publish-to-pypi ]
runs-on: ubuntu-latest
defaults:
run:
working-directory: bindings/nodejs/hvps

steps:
- name: Restore dist from cache
uses: actions/cache@v3
- name: restore source code from cache (contains update to version)
uses: actions/cache@v4
with:
path: dist
key: ${{ runner.os }}-dist-${{ github.sha }}-${{ github.run_id}}-${{ github.run_number }}
path: ${{ github.workspace }}
key: ${{ runner.os }}-src-${{ github.sha }}-${{ github.run_id}}-${{ github.run_number }}

- name: Publish package 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- uses: actions/setup-node@v4
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
node-version: 20
cache: 'npm'
cache-dependency-path: bindings/nodejs/hvps/package-lock.json
registry-url: 'https://registry.npmjs.org'

publish-to-npm:
needs: [ publish-to-pypi ]
- name: Install dependencies
run: npm ci

- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-node-to-npm:
needs: [ publish-bindings-to-npm ]
runs-on: ubuntu-latest
defaults:
run:
working-directory: bindings/nodejs
working-directory: bindings/nodejs/nodered

steps:
- name: Checkout code
uses: actions/checkout@v3
- name: restore source code from cache (contains update to version)
uses: actions/cache@v4
with:
path: ${{ github.workspace }}
key: ${{ runner.os }}-src-${{ github.sha }}-${{ github.run_id}}-${{ github.run_number }}

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: 'npm'
cache-dependency-path: bindings/nodejs/package-lock.json
cache-dependency-path: bindings/nodejs/nodered/package-lock.json
registry-url: 'https://registry.npmjs.org'

- name: Update package-lock.json
run: npm install

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Run pre-commit to format files
run: |
python -m pip install pre-commit
pre-commit run --all-files || true # ignore errors, we want to format the files
- name: Push changes
run: |
git config --local user.name "Luis Antonio Obis Aparicio"
git config --local user.email "luis.antonio.obis@gmail.com"
git add package-lock.json
git commit -m "Update nodered package-lock.json"
git push origin HEAD:main
- name: Install dependencies
run: npm ci
23 changes: 14 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: sort-simple-yaml
- id: check-yaml
- id: check-xml
- id: check-ast
- id: check-shebang-scripts-are-executable
- id: requirements-txt-fixer
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- id: debug-statements
- id: name-tests-test
args: [ --pytest-test-first ]
- id: pretty-format-json
args: [ --autofix ]

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.275
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
hooks:
- id: ruff
args: [ "--fix-only" , "--show-fixes" ]
args: [ "--fix" , "--show-fixes" ] # --fix-only

- id: ruff-format
Loading