Skip to content

Diamond2 conversion#54

Merged
ptsOSL merged 14 commits intomainfrom
diamond2-conversion
Oct 10, 2025
Merged

Diamond2 conversion#54
ptsOSL merged 14 commits intomainfrom
diamond2-conversion

Conversation

@ptsOSL
Copy link
Copy Markdown
Collaborator

@ptsOSL ptsOSL commented Sep 11, 2025

Changes to make the new DII lattice, 48.mat, work in the Virtac.

Relatively few changes were required.

@ptsOSL
Copy link
Copy Markdown
Collaborator Author

ptsOSL commented Sep 11, 2025

The CI failure is caused by a bug in pytac 0.6.2 which is being worked on

Copy link
Copy Markdown
Member

@T-Nicholls T-Nicholls left a comment

Choose a reason for hiding this comment

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

Looks fine to me, but obviously I need to see the corresponding changes to Pytac & Virtac

Comment thread src/atip/sim_data_sources.py Outdated
Comment thread src/atip/sim_data_sources.py Outdated
Comment thread src/atip/sim_data_sources.py Outdated
@ptsOSL ptsOSL force-pushed the diamond2-conversion branch 3 times, most recently from ccfaa47 to 1e27cd9 Compare September 11, 2025 13:54
@ptsOSL ptsOSL changed the title Diamond2 conversion Draft: Diamond2 conversion Sep 16, 2025
@ptsOSL ptsOSL changed the title Draft: Diamond2 conversion Diamond2 conversion Sep 16, 2025
Comment thread src/atip/load_sim.py Outdated
Comment thread src/atip/sim_data_sources.py Outdated
Comment thread src/atip/rings/create_lattice_matfile.m Outdated
Comment thread src/atip/rings/create_lattice_matfile.m Outdated
Comment thread tests/conftest.py Outdated
Comment thread src/atip/rings/create_lattice_matfile.m Outdated
Comment thread src/atip/sim_data_sources.py Outdated
Comment thread src/atip/rings/create_lattice_matfile.m Outdated
Comment thread tests/conftest.py
Copy link
Copy Markdown
Contributor

@MJGaughran MJGaughran left a comment

Choose a reason for hiding this comment

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

The logic related to RING and THERING is confusing, and I'm not convinced we're unable to at least tidy it up a little bit.

Otherwise, you will want to get all tests to pass on this branch. I imagine the pytac PR will resolve this.

Comment thread src/atip/rings/create_lattice_matfile.m Outdated
% Correct dimension order if necessary.
if size(RING, 1) == 1
RING = permute(RING, [2 1]);
if size(THERING, 1) == 1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would recommend using a separate variable name here and in the rest of the file. If it is using RING from MML, it is afterwards referred to as THERING, which is confusing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

E.g. something like mml_ring

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It also makes the comments confusing, since 'THERING' can sometimes refer to the MML THERING object, and at other times to our use of the variable in this script.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I have made some changes to this. We now use ATIP_RING. If a file containing an ATIP_RING is supplied, we use that, if not then we initialise ATIP_RING from THERING (if it exists). We then modify ATIP_RING and dont change THERING, finally we save ATIP_RING to either the file supplied or a new file called lattice.mat

Comment thread src/atip/rings/create_lattice_matfile.m Outdated
@codecov
Copy link
Copy Markdown

codecov bot commented Oct 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.73%. Comparing base (e37bbde) to head (a689bff).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #54   +/-   ##
=======================================
  Coverage   86.73%   86.73%           
=======================================
  Files           6        6           
  Lines         392      392           
=======================================
  Hits          340      340           
  Misses         52       52           

☔ 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.

ptsOSL added 12 commits October 7, 2025 15:21
This conversion script should work for both
diamond I and diamond II ringmodes. 48.mat is the
latest DII ringmode.
Added a single place to define the ringmodes to tests.
Created a combined fixture for loading both a pytac and
atip lattice. Added a new test which tests just loading
of the atip lattice.
Also tidy up handling of missing RING and THERING
This is not specified in any modern lattice files, so
we do not need to check for this anymore. Checked for 48, I04, DIAD, VMX
Sanity check that a HSTR/VSTR after a sextupole has,
length 0, which should confirm it is part of the sextupole.
@ptsOSL ptsOSL force-pushed the diamond2-conversion branch from 240e622 to 6388498 Compare October 7, 2025 15:34
I also had to regenerate the three mat files so that they store
the variable ATIP_RING instead of RING
@ptsOSL ptsOSL force-pushed the diamond2-conversion branch from 6388498 to 03c2619 Compare October 7, 2025 15:39
@ptsOSL ptsOSL merged commit eed5656 into main Oct 10, 2025
22 checks passed
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.

3 participants