Skip to content

Diamond2 conversion - #23

Open
ptsOSL wants to merge 20 commits into
mainfrom
diamond2-conversion
Open

ptsOSL wants to merge 20 commits into
mainfrom
diamond2-conversion

Conversation

@ptsOSL

@ptsOSL ptsOSL commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator
  • Backwards compatible with D1 ringmodes
  • Adds D2 ringmodes 49 and 48
  • Introduces parameters to allow enabling/disabling simulation settings
  • Create dummy PV limits data when creating csv files in offline mode (such as for D2)

@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 8.19672% with 56 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.30%. Comparing base (face8e7) to head (74b19dc).

Files with missing lines Patch % Lines
src/virtac/create_csv.py 8.57% 32 Missing ⚠️
src/virtac/virtac_server.py 4.16% 23 Missing ⚠️
src/virtac/pv.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
- Coverage   26.39%   25.30%   -1.09%     
==========================================
  Files           5        5              
  Lines         610      648      +38     
==========================================
+ Hits          161      164       +3     
- Misses        449      484      +35     

☔ View full report in Codecov by Harness.
📢 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.

@ptsOSL
ptsOSL force-pushed the diamond2-conversion branch 2 times, most recently from efdce13 to a92b666 Compare September 17, 2026 11:41
@ptsOSL ptsOSL changed the title Draft: Diamond2 conversion Diamond2 conversion Sep 21, 2026
@ptsOSL ptsOSL changed the title Diamond2 conversion Draft: Diamond2 conversion Sep 21, 2026
@ptsOSL
ptsOSL force-pushed the diamond2-conversion branch from a92b666 to 2ef4464 Compare September 21, 2026 14:04
@ptsOSL ptsOSL changed the title Draft: Diamond2 conversion Diamond2 conversion Sep 21, 2026
A1L, A2L, A1N and A2N may also want adding? They are
quadrupoles but I dont know if they are needed for
the feedbacks.
Some PVs end up being named multiple times in certain edge cases where
multiple pyAT elements may be updated by a single PV.
The ReadWriteSimPV, which is the SETI PV written to by
HLA apps, now directly updates the pytac lattice, this is more logical
than previously where it was a proxy which made the ReadSimPV update
the pytac lattice. When the ReadWriteSimPV updates, it calls its own
set function which both updates the lattice and then copies the new
value to its linked ReadSimPV. Ideally this would be read back from
the simulation but this has a time cost and currently would just
return the same value.
The tunefb pvs used depends on the loaded ringmode,
if a diamond2 ringmode is selected, eg 48, then a different
set of quad tune families are used
If it does not exist, then instead of crashing, we
now just continue without supplying any limits data to
the PVs that we create
This must have been re-added by mistake during a
rebase, it wasnt having any effect and is now cleaned up
This code looks more like that in tfb now and also works for both D1 and D2
PV names
In this mode, we dont lookup limits data from the live machine. Instead
we use dummy data which is totally inaccurate, but is required by
Virtac. We may want to make it more realistic in the future
These are more sensible, although still approximate
I modified the code to make it generic and added back in bends
which are many_to_one for D1, but not for D2

Add exception for RF cavities, slightly change bends

We have multiple RF cavities which all get their value
from the master oscillator PV, we just create a single PV which
writes to all of the RF cavities and reads from the first one.
Currently this PV also writes to the harmonic RF cavity. This
should actually have 3xMOSC, but it isnt simulated in at anyway,
so this can be fixed later

Remove bend magnets exception

This is not relevant for D2
When emittance simulation is disabled.
@ptsOSL
ptsOSL force-pushed the diamond2-conversion branch from 2ef4464 to 74b19dc Compare September 22, 2026 11:08
the HRF cavity should be about 3x the MOSC frequency, but the HRF isnt
simulated anyway, so it doesnt matter that we set the wrong value to it.
In the future it should either have its own PV, or we should add a way
to apply a scaling factor to the value we get/set.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The note in this section: I think the first two sentences are factual and the rest are more design decisions. Something that could be discussed in a meeting or recorded in the JIRA ticket for further work planning.

Additionally, this note removes the information from DI, which is still relevant and supported in this version of the code.

So I think perhaps a slimming of this comment and a merge with the DI description explaining the differences between the two would be good.

This branch has not been deployed

No deployments
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.

2 participants