Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.2%) to scientific vocabulary
Repository
ITk Serial Number parser
Basic Info
- Host: GitHub
- Owner: kratsg
- License: bsd-3-clause
- Language: Python
- Default Branch: main
- Homepage: https://kratsg.github.io/itksn/
- Size: 2.09 MB
Statistics
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 4
- Releases: 12
Metadata Files
README.md
itksn v0.4.2
Helper utility for parsing ITk Serial Numbers
Using
From the command line, you can parse serial numbers. If there is an error in parsing, it will loudly complain (sometimes).
``` $ itksn parse 20UPGMC2291234 Container: atlasproject = (enum) atlasdetector b'20' systemcode = (enum) phaseIIupgrade b'U' projectcode = (enum) pixelgeneral b'PG' subprojectcode = (enum) Modulecarrier b'MC' identifier = Container: moduletype = (enum) Lineartripletmodulecarrier b'2' moduleversion = (enum) Quadv2p1 b'2' manufacturer = b'9' (total 1) number = b'1234' (total 4)
$ itksn parse 20UPGR90012345 Container: atlasproject = (enum) atlasdetector b'20' systemcode = (enum) phaseIIupgrade b'U' projectcode = (enum) pixelgeneral b'PG' subprojectcode = (enum) Digitalquadmodule b'R9' identifier = Container: FEchip_version = (enum) RD53A b'0' reserved = b'0' (total 1) number = b'12345' (total 5)
$ itksn parse 20UPGPD0012345 Container: atlasproject = (enum) atlasdetector b'20' systemcode = (enum) phaseIIupgrade b'U' projectcode = (enum) pixelgeneral b'PG' subprojectcode = (enum) DualPCB b'PD' identifier = Container: FEchipversion = (enum) RD53A b'0' reserved = b'0' (total 1) number = b'12345' (total 5)
$ itksn parse 20UPGFW2123456 Container: atlasproject = (enum) atlasdetector b'20' systemcode = (enum) phaseIIupgrade b'U' projectcode = (enum) pixelgeneral b'PG' subprojectcode = (enum) FEchipwafer b'FW' identifier = Container: batchnumber = (enum) CROC b'2' number = b'123456' (total 6) ```
If you want to, for example, build the serial number for a front-end chip hex, you can do:
```python import itksn
number = str(0x20098).zfill(7).encode() obj = { "atlasproject": "atlasdetector", "systemcode": "phaseIIupgrade", "projectcode": "pixelgeneral", "subprojectcode": "FEchip", "identifier": {"number": number}, }
itksn.core.SerialNumberStruct.build(obj) # b'20UPGFC0131224' ```
or even from python, one can parse
```python import itksn
results = itksn.parse(b"20UPGR90012345") assert results.atlasproject == "atlasdetector" assert results.projectcode == "pixel" assert results.identifier.PCBmanufacturer == "Dummy" ```
or build
```python from itksn.core import SerialNumberStruct
sn = SerialNumberStruct.build( { "atlasproject": "atlasdetector", "systemcode": "phaseIIupgrade", "projectcode": "pixel", "subprojectcode": "pixelgeneral", "componentcode": "Digitalquadmodule", "identifier": { "FEchipversion": "RD53A", "PCB_manufacturer": "Dummy", "number": b"12345", }, } ) assert sn == b"20UPGR90012345" ```
Installation
In a fresh virtual environment, you can install from PyPI:
$ python -m pip install itksn
or from the main branch of the GitHub repository:
$ python -m pip install "git+https://github.com/kratsg/itksn.git"
The above is actually cloning and installing directly from the Git repository.
However, if you want to, you can of course also install it directly from the Git repository "locally" by first cloning the repo and then from the top level of it running
$ python -m pip install .
Contributing
As this library is experimental contributions of all forms are welcome.
If you have ideas on how to improve the API or fix a bug please open an Issue.
You are of course also most welcome and encouraged to open PRs.
Developing
To develop, use a virtual environment.
Once the environment is activated, clone the repo from GitHub
git clone git@github.com:kratsg/itksn.git
and you can use hatch for running tests/development, e.g.
hatch run +py=3.7 dev:test
(Optional) Then setup the Git pre-commit hooks by running
pre-commit install
Acknowledgements
- @matthefeickert's heputilities repository for a quick start
References
Owner
- Name: Giordon Stark
- Login: kratsg
- Kind: user
- Company: SCIPP, University of California, Santa Cruz
- Website: https://giordonstark.com/
- Twitter: kratsg
- Repositories: 148
- Profile: https://github.com/kratsg
Proton Smashing, Code Crashing, and ROM Flashing, keybase.io/kratsg
Citation (CITATION.cff)
cff-version: 1.2.0 message: "Please cite the following works when using this software." type: software authors: - family-names: "Stark" given-names: "Giordon" orcid: "https://orcid.org/0000-0001-6616-3433" affiliation: "SCIPP, University of California, Santa Cruz" title: "itksn: v0.4.2" version: 0.4.2 doi: 10.5281/zenodo.7644145 repository-code: "https://github.com/kratsg/itksn/releases/tag/v0.4.2" url: "https://kratsg.github.io/itksn/0.4.2/" keywords: - python - physics - construct - parsing license: "BSD-3.0" abstract: | itksn is a Serial Number parser (and builder) for the ATLAS ITk project.
GitHub Events
Total
- Create event: 18
- Release event: 4
- Issues event: 7
- Watch event: 1
- Delete event: 16
- Issue comment event: 7
- Push event: 66
- Pull request event: 31
- Fork event: 1
Last Year
- Create event: 18
- Release event: 4
- Issues event: 7
- Watch event: 1
- Delete event: 16
- Issue comment event: 7
- Push event: 66
- Pull request event: 31
- Fork event: 1
Committers
Last synced: about 3 years ago
All Time
- Total Commits: 30
- Total Committers: 4
- Avg Commits per committer: 7.5
- Development Distribution Score (DDS): 0.3
Top Committers
| Name | Commits | |
|---|---|---|
| Giordon Stark | k****g@g****m | 21 |
| pre-commit-ci[bot] | 6****]@u****m | 4 |
| Giordon Stark | k****g@u****m | 4 |
| dependabot[bot] | 4****]@u****m | 1 |
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 9
- Total pull requests: 128
- Average time to close issues: 5 months
- Average time to close pull requests: 14 days
- Total issue authors: 3
- Total pull request authors: 4
- Average comments per issue: 0.22
- Average comments per pull request: 0.14
- Merged pull requests: 114
- Bot issues: 1
- Bot pull requests: 111
Past Year
- Issues: 5
- Pull requests: 30
- Average time to close issues: 13 days
- Average time to close pull requests: 10 days
- Issue authors: 2
- Pull request authors: 4
- Average comments per issue: 0.4
- Average comments per pull request: 0.33
- Merged pull requests: 23
- Bot issues: 1
- Bot pull requests: 24
Top Authors
Issue Authors
- kratsg (7)
- lime86 (1)
Pull Request Authors
- pre-commit-ci[bot] (85)
- dependabot[bot] (37)
- kratsg (18)
- lime86 (4)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 791 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 14
- Total maintainers: 1
pypi.org: itksn
ITk Serial Number parser
- Homepage: https://github.com/kratsg/itksn
- Documentation: https://kratsg.github.io/itksn/0.4/
- License: BSD License
-
Latest release: 0.4.2
published 11 months ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v3 composite
- actions/setup-python v4 composite
- actions/upload-artifact v3 composite
- pre-commit/action v3.0.0 composite
- pypa/gh-action-pypi-publish v1.8.8 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- construct >=2.10
- typer *
- typing_extensions >=3.7; python_version<'3.11'