Skip to content

Asyncio conversion - #62

Merged
ptsOSL merged 18 commits into
mainfrom
asyncio-conversion
Oct 13, 2026
Merged

ptsOSL merged 18 commits into
mainfrom
asyncio-conversion

Conversation

@ptsOSL

@ptsOSL ptsOSL commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator
  • Convert atip to asyncio
  • Run the simulation recalculation in a separate process which is awaited
  • Add CLI argument to allow users to test atip
  • Tests pass locally with local pytac version, waiting for pytac changes to be merged to work in CI

ptsOSL added 13 commits October 1, 2026 16:59
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.
Added: Awaits and asyncio, switch from cothread queue to asyncio queue, caput/cage/camonitor from aioca instead of cothread, changed how the code is run (now uses asyncio.run()), made some necessary changes to events and when they are set/cleared, removed most references to cothread besides a few in the documentation which will be updated seperately and those in create_csv.py which will be updated later
CPU intensive recalculations are now done on a seperate cpu core. This means can now handle CA requests at the same time as doing the calculation. Fresh values will only be output to records after recalculation is done while the up_to_date event is set. So the output pvs will still be to date with the last processed pv setpoint. There may still be setpoints in the queue waiting to be processed, so the output data will not be up to date with these
Add test functionality to atip as well as configuration to run it from vscode. This means that something actually happens when you run the 'atip' command if you pass '-t'. This makes it easier to test atip without virtac. Also changed vscode default CA ports to 806*.
This is not needed as we use argparse
@ptsOSL ptsOSL changed the title draft: Asyncio conversion Asyncio conversion Oct 7, 2026
Comment thread src/atip/simulator.py Resolved
Comment thread tests/conftest.py Resolved
@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.50427% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.59%. Comparing base (0aabb4b) to head (280275c).

Files with missing lines Patch % Lines
src/atip/__main__.py 0.00% 12 Missing ⚠️
src/atip/utils.py 33.33% 12 Missing ⚠️
src/atip/simulator.py 90.90% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #62      +/-   ##
==========================================
- Coverage   85.84%   85.59%   -0.26%     
==========================================
  Files           6        6              
  Lines         431      472      +41     
==========================================
+ Hits          370      404      +34     
- Misses         61       68       +7     

☔ 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 merged commit 890136b into main Oct 13, 2026
20 of 23 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.

2 participants