Skip to content

118 p4p transport - #119

Merged
evvaaaa merged 8 commits into
mainfrom
118-p4p-transport
Mar 6, 2025
Merged

evvaaaa merged 8 commits into
mainfrom
118-p4p-transport

Conversation

@evvaaaa

@evvaaaa evvaaaa commented Feb 3, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@evvaaaa evvaaaa self-assigned this Feb 3, 2025
@evvaaaa
evvaaaa marked this pull request as draft February 3, 2025 15:54
@codecov

codecov Bot commented Feb 4, 2025 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 96.33028% with 16 lines in your changes missing coverage. Please review.

Project coverage is 89.66%. Comparing base (88f80a2) to head (d0df0b3).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/fastcs/transport/epics/pva/types.py 91.81% 9 Missing ⚠️
src/fastcs/transport/epics/pva/adapter.py 90.90% 2 Missing ⚠️
src/fastcs/transport/epics/pva/ioc.py 96.07% 2 Missing ⚠️
src/fastcs/datatypes.py 95.83% 1 Missing ⚠️
src/fastcs/transport/epics/pva/_pv_handlers.py 98.70% 1 Missing ⚠️
src/fastcs/transport/epics/pva/pvi_tree.py 98.97% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #119      +/-   ##
==========================================
+ Coverage   87.84%   89.66%   +1.82%     
==========================================
  Files          33       40       +7     
  Lines        1456     1858     +402     
==========================================
+ Hits         1279     1666     +387     
- Misses        177      192      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@evvaaaa
evvaaaa force-pushed the 118-p4p-transport branch 3 times, most recently from 89d3a1a to 425e23b Compare February 5, 2025 16:27
@evvaaaa

evvaaaa commented Feb 6, 2025

Copy link
Copy Markdown
Contributor Author

PVI table working as it should.

[:(] pvget DEVICE:PVI 
DEVICE:PVI structure 
    structure[] value
        structure 
            string pv DEVICE:A
            string access r
        structure 
            string pv DEVICE:B
            string access rw
        structure 
            string pv DEVICE:Child:PVI
            string access pvi

@coretl

coretl commented Feb 6, 2025

Copy link
Copy Markdown
Contributor

PVI table working as it should.

[:(] pvget DEVICE:PVI 
DEVICE:PVI structure 
    structure[] value
        structure 
            string pv DEVICE:A
            string access r
        structure 
            string pv DEVICE:B
            string access rw
        structure 
            string pv DEVICE:Child:PVI
            string access pvi

Please could you match the structure of the old implementation:

BL22I-EA-PANDA-01:BITS:PVI structure 
    alarm_t alarm 
        int severity 0
        int status 0
        string message 
    time_t timeStamp 2025-02-05 16:19:51.151  
        long secondsPastEpoch 1738772391
        int nanoseconds 150652183
        int userTag 0
    structure display
        string description PVs making up Interface for BITS
    structure value
        structure a
            string rw BL22I-EA-PANDA-01:BITS:A
        structure b
            string rw BL22I-EA-PANDA-01:BITS:B
        ...
BL22I-EA-PANDA-01:PVI structure 
    ...
    structure value
        structure bits
            string d BL22I-EA-PANDA-01:BITS:PVI
        structure[] calc
            (none)
            structure 
                string d BL22I-EA-PANDA-01:CALC1:PVI
            structure 
                string d BL22I-EA-PANDA-01:CALC2:PVI
        ...

@evvaaaa
evvaaaa force-pushed the 118-p4p-transport branch 2 times, most recently from 7a0a384 to 464ee5e Compare February 6, 2025 14:24
@evvaaaa

evvaaaa commented Feb 6, 2025 •

Copy link
Copy Markdown
Contributor Author

@coretl

PVI table working as it should...

Okay, I've mirrored this exactly, apart from points below:

Description

I was wondering about putting description at the top level rather than in the display substruct? I've added a new optional field called "description" to FastCS controllers now that it's needed.

[:)] pvget DEVICE:Child:PVI
[:)] pvget DEVICE:PVI      
DEVICE:PVI structure 
    alarm_t alarm 
        int severity 0
        int status 0
        string message 
    time_t timeStamp 2025-02-06 14:24:34.645  
        long secondsPastEpoch 1738851874
        int nanoseconds 644680500
    string description 
    structure[] value
        structure 
            string pv DEVICE:A
            string access r
        structure 
            string pv DEVICE:B
            string access rw
        structure 
            string pv DEVICE:Child:PVI
            string access pvi

Command access

I've also added another access for command:

        structure 
            string pv DEVICE:Child:H
            string access rw
        structure 
            string pv DEVICE:Child:D
            string access command

I don't know if you want to keep it as w? The commands here do a different thing. The are bools and when triggered they stay as true until the callable has ended. You can also put false to them to cancel the command task while they're true.

Blocks in their own structures

The below seems difficult to do in a generic way:

    structure value
        structure bits
            string d BL22I-EA-PANDA-01:BITS:PVI
        structure[] calc
            (none)
            structure 
                string d BL22I-EA-PANDA-01:CALC1:PVI
            structure 
                string d BL22I-EA-PANDA-01:CALC2:PVI

We'd have to check for the same name, up to a differing suffix number. Is this something we'd want to do?

Still needs tests.
@evvaaaa

evvaaaa commented Feb 7, 2025 •

Copy link
Copy Markdown
Contributor Author

Going to have to make a ControllerVector to pair up pvs without using end numbers. The below is what we get now from the assumption that Child1 and Child2 should live in child based on the end numbers. I'll make another issue for this since it's not needed for the panda.

DEVICE:PVI structure 
    alarm_t alarm 
        int severity 0
        int status 0
        string message 
    time_t timeStamp 2025-02-07 13:49:58.188  
        long secondsPastEpoch 1738936198
        int nanoseconds 187610864
    structure display
        string description some controller
    structure value
        structure a
            string r DEVICE:A
        structure b
            string rw DEVICE:B
        structure[] child
            structure 
                string pvi DEVICE:Child1:PVI
            structure 
                string pvi DEVICE:Child2:PVI
DEVICE:Child2:PVI structure 
    alarm_t alarm 
        int severity 0
        int status 0
        string message 
    time_t timeStamp 2025-02-07 13:49:58.188  
        long secondsPastEpoch 1738936198
        int nanoseconds 187722921
    structure display
        string description another sub controller
    structure value
        structure c
            string w DEVICE:Child2:C
        structure e
            string r DEVICE:Child2:E
        structure f
            string rw DEVICE:Child2:F
        structure g
            string rw DEVICE:Child2:G
        structure h
            string rw DEVICE:Child2:H
        structure d
            string x DEVICE:Child2:D
        structure i
            string x DEVICE:Child2:I

@evvaaaa
evvaaaa force-pushed the 118-p4p-transport branch 2 times, most recently from 87bb814 to 8c9d8ef Compare February 7, 2025 14:17
@coretl

coretl commented Feb 7, 2025 •

Copy link
Copy Markdown
Contributor
structure[] child
            structure 
                string pvi DEVICE:Child1:PVI
            structure 
                string pvi DEVICE:Child2:PVI

Bear in mind that if we have child1 and child2 there should be a None as the first entry of the array...

Also string pvi ... here should be string d ... for back compat (d stands for "device")

@evvaaaa

evvaaaa commented Feb 11, 2025

Copy link
Copy Markdown
Contributor Author

Bear in mind that if we have child1 and child2 there should be a None as the first entry of the array...

I was planning on leaving that to the PR which adds 'vectors' of child devices so we know what should be paired on the PVI end. For this PR while we're checking end numbers I can just manually add in (none) for undefined elements lower than the max.

@coretl

coretl commented Feb 11, 2025

Copy link
Copy Markdown
Contributor

At the moment we have

value:
  pulse:
    - null
    - d: PANDA:PULSE1:PVI
    - d: PANDA:PULSE2:PVI

@coretl

coretl commented Feb 11, 2025

Copy link
Copy Markdown
Contributor

I think we should do:

value:
  pulse:
    d:
      v1: PANDA:PULSE1:PVI
      v2: PANDA:PULSE2:PVI

Still have to deal with multiple numbered subcontrollers more reliably.
@evvaaaa

evvaaaa commented Feb 11, 2025

Copy link
Copy Markdown
Contributor Author

I think we should do:

Done:

[:)] pvget -v P4P_TEST_DEVICE:PVI       
P4P_TEST_DEVICE:PVI structure 
    alarm_t alarm 
        int severity 0
        int status 0
        string message 
    time_t timeStamp 2025-02-11 16:07:40.328  
        long secondsPastEpoch 1739290060
        int nanoseconds 327772140
    structure display
        string description some controller
    structure value
        structure a
            string r P4P_TEST_DEVICE:A
        structure b
            string rw P4P_TEST_DEVICE:B
        structure table
            string rw P4P_TEST_DEVICE:Table
        structure child
            structure d
                string v1 P4P_TEST_DEVICE:Child1:PVI
                string v2 P4P_TEST_DEVICE:Child2:PVI

Comment thread src/fastcs/datatypes.py Resolved
@evvaaaa
evvaaaa force-pushed the 118-p4p-transport branch 2 times, most recently from a153e0a to 91bda8b Compare February 19, 2025 15:29
@evvaaaa
evvaaaa requested a review from GDYendell February 20, 2025 08:46
* General fixes.
* Use `buildType` directly on `NTScalar`. This necessitates passing a
wrap into the `SharedPV` instead of an `nt`.
* Made `EpicsPVAOptions` and `EpicsCAOptions` (containing the same
suboptions).
* Renamed instances of `softioc` with `ca` and `p4p` with `pva` in the
public API.

@evvaaaa evvaaaa left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments from group review, @coretl to review pva/types.py seperately.

Comment thread src/fastcs/transport/epics/pva/ioc.py Resolved
Comment thread src/fastcs/transport/epics/pva/ioc.py Resolved
Comment thread src/fastcs/transport/epics/pva/ioc.py Resolved
Comment thread src/fastcs/transport/epics/pva/ioc.py Resolved
@evvaaaa evvaaaa linked an issue Mar 3, 2025 that may be closed by this pull request
Commands now raise an error if initiated while already running.
The command can spawn a task if it should run for a longer length of
time, or needs to be ran multiple times concurrently.
@evvaaaa
evvaaaa force-pushed the 118-p4p-transport branch from 91bda8b to d0df0b3 Compare March 3, 2025 10:37
@evvaaaa
evvaaaa requested review from GDYendell and coretl March 3, 2025 10:37
@GDYendell

Copy link
Copy Markdown
Contributor

I have just had another quick review and I think this looks good. Are you still tweaking this alongside fastcs-panda?

@evvaaaa

evvaaaa commented Mar 6, 2025

Copy link
Copy Markdown
Contributor Author

I have just had another quick review and I think this looks good. Are you still tweaking this alongside fastcs-panda?

Nah, GTM. I'm currently changing the panda to not use root_attribute stuff, which will be removed from fastcs soon.

@GDYendell

GDYendell commented Mar 6, 2025 •

Copy link
Copy Markdown
Contributor

@coretl are you happy to merge? There is still the "why is this a list?" comment.

@evvaaaa

evvaaaa commented Mar 6, 2025

Copy link
Copy Markdown
Contributor Author

There is still the "why is this a list?"

Will make an issue upstream.

@evvaaaa
evvaaaa merged commit 4fa411c into main Mar 6, 2025
@evvaaaa
evvaaaa deleted the 118-p4p-transport branch March 6, 2025 14:44
evvaaaa pushed a commit to bluesky/ophyd-async that referenced this pull request Mar 17, 2025
FastCS pva uses a new pvi structure:

DiamondLightSource/fastcs#119 (comment).

This change supports this new structure.
evvaaaa pushed a commit to bluesky/ophyd-async that referenced this pull request Mar 17, 2025
FastCS pva uses a new pvi structure:

DiamondLightSource/fastcs#119 (comment).

This change supports this new structure.
evvaaaa pushed a commit to bluesky/ophyd-async that referenced this pull request Mar 17, 2025
FastCS pva uses a new pvi structure:

DiamondLightSource/fastcs#119 (comment).

This change supports this new structure.
evvaaaa pushed a commit to bluesky/ophyd-async that referenced this pull request Mar 17, 2025
FastCS pva uses a new pvi structure:

DiamondLightSource/fastcs#119 (comment).

This change supports this new structure.
evvaaaa added a commit to bluesky/ophyd-async that referenced this pull request Mar 18, 2025
FastCS pva uses a new pvi structure:

DiamondLightSource/fastcs#119 (comment).

This change supports this new structure.
paula-mg pushed a commit to bluesky/ophyd-async that referenced this pull request Mar 26, 2025
FastCS pva uses a new pvi structure:

DiamondLightSource/fastcs#119 (comment).

This change supports this new structure.
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.

Create a P4P transport

3 participants