Skip to content

Commit

Permalink
Merge pull request #981 from slaclab/pre-release
Browse files Browse the repository at this point in the history
Release Candidate v6.1.2
  • Loading branch information
bengineerd authored Feb 8, 2024
2 parents 64ac9ce + e250419 commit 0a7d4dd
Show file tree
Hide file tree
Showing 14 changed files with 227 additions and 119 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rogue_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
file: ./docker/rogue
push: true
tags: tidair/rogue:${{ steps.get_image_info.outputs.tag }}, tidair/rogue:latest
build-args: branch=${{ steps.get_image_info.outputs.branch }}
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023, The Board of Trustees of the Leland Stanford Junior
Copyright (c) 2024, The Board of Trustees of the Leland Stanford Junior
University, through SLAC National Accelerator Laboratory (subject to receipt
of any required approvals from the U.S. Dept. of Energy). All rights reserved.
Redistribution and use in source and binary forms, with or without
Expand Down
19 changes: 19 additions & 0 deletions docker/rogue-anaconda/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM continuumio/anaconda3

RUN apt-get update && \
apt-get install -y \
g++ \
gcc \
git \
cmake \
make

RUN conda config --set channel_priority strict &&\
conda install -n base conda-libmamba-solver &&\
conda config --set solver libmamba

RUN conda create -n rogue_tag -c tidair-tag -c conda-forge rogue

RUN echo "source activate rogue_tag" > ~/.bashrc

ENV PATH /opt/conda/envs/rogue_tag/bin:$PATH
4 changes: 2 additions & 2 deletions Dockerfile → docker/rogue/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.10
FROM ubuntu:22.04

# Install system tools
RUN apt-get update && apt-get install -y \
Expand All @@ -21,7 +21,7 @@ RUN pip3 install PyYAML parse click ipython pyzmq packaging matplotlib numpy p4p
RUN pip3 install pydm>=1.18.0

# Install Rogue
ARG branch
ARG branch=main
WORKDIR /usr/local/src
RUN git clone https://github.com/slaclab/rogue.git -b $branch
WORKDIR rogue
Expand Down
78 changes: 49 additions & 29 deletions docs/src/migration/rogue_v6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ Similiarly the previous feature which allowed the user to pass the root class to
class ExampleRoot(pyrogue.Root):
def __init__(self):
pyrogue.Root.__init__(self,
description="Example Root",
timeout=2.0,
pollEn=True)
pyrogue.Root.__init__(self,
description="Example Root",
timeout=2.0,
pollEn=True)
# Add zmq server, keep it as an attribute so we can access it later
self.zmqServer = pyrogue.interfaces.ZmqServer(root=self, addr='*', port=0)
self.addInterface(self.zmqServer)
# Add zmq server, keep it as an attribute so we can access it later
self.zmqServer = pyrogue.interfaces.ZmqServer(root=self, addr='127.0.0.1', port=0)
self.addInterface(self.zmqServer)
with ExampleRoot() as root:
pyrogue.pydm.runPyDM(serverList=root.zmqServer.address,title='Test UI',sizeX=1000,sizeY=500)
pyrogue.pydm.runPyDM(serverList=root.zmqServer.address,title='Test UI',sizeX=1000,sizeY=500)
More information can be found int he ZmqServer class documenation (TBD).
Expand All @@ -44,13 +44,13 @@ Similiar to the zmqServer, the sql logger is now removed to be an external inter
class ExampleRoot(pyrogue.Root):
def __init__(self):
pyrogue.Root.__init__(self,
description="Example Root",
timeout=2.0,
pollEn=True)
pyrogue.Root.__init__(self,
description="Example Root",
timeout=2.0,
pollEn=True)
# Add sql logger
self.addInterface(pyrogue.interfaces.SqlLogger(root=self, url='sqlite:///test.db'))
# Add sql logger
self.addInterface(pyrogue.interfaces.SqlLogger(root=self, url='sqlite:///test.db'))
More information can be found int he SqlLogger class documenation (TBD).
Expand All @@ -66,17 +66,17 @@ In previous versions of rogue the Root class automatically supported the ability
class ExampleRoot(pyrogue.Root):
def __init__(self):
pyrogue.Root.__init__(self,
description="Example Root",
timeout=2.0,
pollEn=True)
pyrogue.Root.__init__(self,
description="Example Root",
timeout=2.0,
pollEn=True)
# Create configuration stream
stream = pyrogue.interfaces.stream.Variable(root=self)
# Create configuration stream
stream = pyrogue.interfaces.stream.Variable(root=self)
# Create StreamWriter with the configuration stream included as channel 1
sw = pyrogue.utilities.fileio.StreamWriter(configStream={1: stream})
self.add(sw)
# Create StreamWriter with the configuration stream included as channel 1
sw = pyrogue.utilities.fileio.StreamWriter(configStream={1: stream})
self.add(sw)
EPICS Version 3 Channel Access Server
Expand All @@ -89,13 +89,13 @@ Epics version 3 channel access server is removed from Rogue V6. Please use the e
class ExampleRoot(pyrogue.Root):
def __init__(self):
pyrogue.Root.__init__(self,
description="Example Root",
timeout=2.0,
pollEn=True)
pyrogue.Root.__init__(self,
description="Example Root",
timeout=2.0,
pollEn=True)
pvserv = pyrogue.protocols.epicsV4.EpicsPvServer(base="test", root=self,incGroups=None,excGroups=None)
self.addProtocol(pvserv)
pvserv = pyrogue.protocols.epicsV4.EpicsPvServer(base="test", root=self,incGroups=None,excGroups=None)
self.addProtocol(pvserv)
RawWrite and RawRead
Expand All @@ -105,4 +105,24 @@ The deprecated rawWrite and rawRead calls are removed from Rogue V6. The new arr



Setting pollInterval
====================

There API for setting a Variable's pollInterval has
changed. Previously, it could be set directly:

.. code::
someVar.pollInterval = 5 # Poll someVar every 5 seconds
This has been deprecated in favor of:

.. code::
someVar.setPollInterval(5) # Poll someVar every 5 seconds
The reasoning is that a lot happens behind the scences when changing a
poll interval, and masking this with a setter decorator gives the user
the impression that it is much simpler than it is.

2 changes: 1 addition & 1 deletion python/pyrogue/_Device.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ def setPollInterval(self, interval, variables=None):
variables = [k for k,v in self.variables.items() if v.pollInterval != 0]

for x in variables:
self.node(x).pollInterval = interval
self.node(x).setPollInterval(interval)

def hideVariables(self, hidden, variables=None):
"""
Expand Down
8 changes: 7 additions & 1 deletion python/pyrogue/_Node.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ class Node(object):
-------
"""
_nodeCount = 0

def __init__(self, *, name, description="", expand=True, hidden=False, groups=None, guiGroup=None):
"""
Expand Down Expand Up @@ -183,6 +184,7 @@ def __init__(self, *, name, description="", expand=True, hidden=False, groups=No
-------
"""
pr.Node._nodeCount += 1

# Public attributes
self._name = name
Expand Down Expand Up @@ -213,6 +215,10 @@ def __init__(self, *, name, description="", expand=True, hidden=False, groups=No
def __repr__(self):
return f'{self.__class__} - {self.path}'

@property
def nodeCount(self):
return pr.Node._nodeCount

@property
def name(self):
"""
Expand Down Expand Up @@ -559,7 +565,7 @@ def addNodes(self, nodeClass, number, stride, **kwargs):
def nodeList(self):
"""Get a recursive list of nodes."""
lst = []
for key,value in self.nodes.items():
for key,value in self._nodes.items():
lst.append(value)
lst.extend(value.nodeList)
return lst
Expand Down
2 changes: 1 addition & 1 deletion python/pyrogue/examples/_ExampleRoot.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(self, epics4En=False):
self.add(pyrogue.RunControl())

# Add zmq server
self.zmqServer = pyrogue.interfaces.ZmqServer(root=self, addr='*', port=0)
self.zmqServer = pyrogue.interfaces.ZmqServer(root=self, addr='127.0.0.1', port=0)
self.addInterface(self.zmqServer)

# Add sql logger
Expand Down
6 changes: 5 additions & 1 deletion python/pyrogue/interfaces/_ZmqServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ class ZmqServer(rogue.interfaces.ZmqServer):
def __init__(self,*,root,addr,port,incGroups=None, excGroups=['NoServe']):
rogue.interfaces.ZmqServer.__init__(self,addr,port)
self._root = root
self._addr = addr
self._root.addVarListener(func=self._varUpdate, done=self._varDone, incGroups=incGroups, excGroups=excGroups)
self._updateList = {}

@property
def address(self):
return f"localhost:{self.port()}"
if self._addr == "*":
return f"127.0.0.1:{self.port()}"
else:
return f"{self._addr}:{self.port()}"

def _doOperation(self,d):
path = d['path'] if 'path' in d else None
Expand Down
Loading

0 comments on commit 0a7d4dd

Please sign in to comment.