-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add caproto Zebra IOC #2
Conversation
…tuptools to an older version; more verbose test output
act -W .github/workflows/ci.yml -j checks --matrix python-version:3.11 NOTE: Python 3.12 build fails on a datetime/TZ issue. | OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k | ImportError while loading conftest '/Users/mrakitin/src/NSLS-II/SRX/srx-caproto-iocs/tests/conftest.py'. | tests/conftest.py:13: in <module> | from srx_caproto_iocs.base import OphydDeviceWithCaprotoIOC | /opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/srx_caproto_iocs/base.py:11: in <module> | from caproto import ChannelType | /opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/caproto/__init__.py:2: in <module> | from ._utils import * | /opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/caproto/_utils.py:29: in <module> | from ._dbr import SubscriptionType | /opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/caproto/_dbr.py:17: in <module> | from ._constants import (EPICS2UNIX_EPOCH, EPICS_EPOCH, MAX_ENUM_STATES, | /opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/caproto/_constants.py:11: in <module> | EPICS_EPOCH = datetime.datetime.utcfromtimestamp(EPICS2UNIX_EPOCH) | E DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
I've opened caproto/caproto#838 to report the issue we are observing with Python 3.12. |
add `suid` to filename formatter
…nt_dataset` method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good.
I have some general suggestions in the comments.
Also, it seems we have from __future__ import annotations
at the beginning of every file, but we are not using type hints much, if not at all.
.github/workflows/ci.yml
Outdated
@@ -57,13 +63,34 @@ jobs: | |||
python-version: ${{ matrix.python-version }} | |||
allow-prereleases: true | |||
|
|||
- name: Set env vars | |||
run: | | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a set -x
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would not hurt. I copied this piece from other workflows where we don't use set
for the step, but it's OK to add.
scripts/test-file-saving.sh
Outdated
|
||
data_dir="/tmp/test/$(date +%Y/%m/%d)" | ||
|
||
if [ ! -d "${data_dir}" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if
block is probably not needed since you are using mkdir -p
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, it can be eliminated.
frame_num = dataset.shape[0] | ||
|
||
# https://docs.h5py.org/en/stable/swmr.html | ||
h5file_desc.swmr_mode = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty cool feature, didn't know it existed! If it may help someone I'd add a comment here to mention that older HDF5 libraries do not support reading those files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, please add the comment.
import shutil | ||
import time as ttime | ||
import uuid | ||
from pathlib import Path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This import is not being used for testing anything
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used in the test_base_ophyd_templates
test a number of times.
tests/test_base_ophyd.py
Outdated
date = now(as_object=True) | ||
write_dir_root = Path(tmpdirname) | ||
dir_template = f"{write_dir_root}/{date_template}" | ||
write_dir = Path(date.strftime(dir_template)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if we need to "manually" strftime
here. Shouldn't that happen when we stage base_ophyd_device
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's to make the directory structure on the next line. What we pass to the ophyd object and then to the caproto IOC is dir_template
.
That import is automatically added by pre-commit. I didn't want to fight with it, so just left it as is. |
…t`, `cainfo`, etc.)
* replaces unsupport characters with underscores _ * github artifact upload does not support the special chars: - Double quote " - Colon : - Less than < - Greater than > - Vertical bar | - Asterisk * - Question mark ? - Carriage return \r - Line feed \n * note that \r, \n are included in whitespace regex symbol \s
String/Char caproto IOC with demo tests
…esky side should do the logic and call the saver when done
Dev/tests for Zebra Saver IOC
We are going to merge it to test at SRX. |
WIP with @hyperrealist