-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Containerise tickit devices #16
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## main #16 +/- ##
=======================================
Coverage 84.30% 84.30%
=======================================
Files 3 3
Lines 172 172
=======================================
Hits 145 145
Misses 27 27 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
abbiemery
force-pushed
the
containerise-tickit-devices
branch
from
August 19, 2022 13:56
da9f7c0
to
0c4195f
Compare
abbiemery
pushed a commit
that referenced
this pull request
Jun 15, 2023
* Try to fix #4 for cryostream only * Fix the mypy error for raise_interrupt * Try to fix #4 for cryostream only * Fix the mypy error for raise_interrupt * Ported everything apart from nested and tests * Support SystemSimulation * Fixed remaining tests * Fix docs * Update tickit/core/management/event_router.py Co-authored-by: Garry O'Donnell <[email protected]> * Update tickit/cli.py Co-authored-by: Garry O'Donnell <[email protected]> * Update tickit/cli.py Co-authored-by: Garry O'Donnell <[email protected]> * Update tickit/core/components/system_simulation.py Co-authored-by: Garry O'Donnell <[email protected]> * Update tickit/core/components/device_simulation.py Co-authored-by: Garry O'Donnell <[email protected]> * Fix event_router indentation * Add test for as_tagged_union and fix bug * Rename lifetime_runnable to runner * Fix test_runner to use correct mock library Co-authored-by: Garry O'Donnell <[email protected]> Co-authored-by: Garry O'Donnell <garry.o'[email protected]>
abbiemery
pushed a commit
that referenced
this pull request
Jun 15, 2023
* Install pytest-pydocstyle * Configure pytest to use pydocstyle * Lock with DLS PyPi * Ignore module & package docstrings * Fix loading docstrings * Fix configurable docstrings * Fix topic_naming docstrings * Fix singleton docstrings * Fix byte_format docstrings * Fix source docstrings * Fix sink docstrings * Fix state_interface docstrings * Bump pydocstyle to 6.1.1 * Fix kafka docstrings * Fix internal docstrings * Fix slave docstrings * Fix master docstrings * Fix base docstrings * Fix ticker docstrings * Fix device_simulation docstrings * Fix system_simulation docstrings * Fix component docstrings * Fix typedefs docstrings * Fix lifetime_runnable docstrings * Fix device docstrings * Fix adapter docstrings * Fix tcp docstrings * Fix regex_command docstrings * Fix command_interpreter docstrings * Fix composed docstrings * Fix remote_controlled docstrings * Fix shutter docstrings * Fix trampoline docstrings * Fix _version_git docstrings * Re-lock pipfile.lock * Add cli docstrings * Add D418 to pydocstyle ignore * Fix event_router docstrings * Refactor epicsadapter * Update EpicsAdapter adapters * Update example configs * Fix base docstrings * Fix shutter docstrings * Fix cryostream docstrings * Fix states docstrings * Fix status docstrings * Enable pydocstyle linting * Add simple docstrings to pneumatic * Make flake8 complient * Added docstrings to femto.py; Changed 'records' function in femto, pneumatic and epicsadapter to 'on_db_load' to better reflect what it does; Updated Pipfile to include charset-normalizer * Fixed some docstring formatting * Fixed line lengths * Update tickit/devices/pneumatic/pneumatic.py Co-authored-by: Garry O'Donnell <[email protected]> * Removed whitespace * Changed a couple of docstrings to include args and return values * Remove charset-normalizer * Edited set_state function * Fix typechecking error * Basic epics adapter sanity checks * Add tests for cli.py * Remove unused import * Add tests for CryostreamBase class * Improved Exception handling, Improved code readability Base Exception classes substituted for ValueErrors where appropriate. Hard coded RunMode values removed in favor of using the RunMode enum. Made TODO flags fully capitalised to properly integrate with IDE. * Add check on 'status' attribute before accessing. Previously there was no check on whether the 'status' attribue was set before accessing using the 'get_status' method. Now the 'get_status' method will use the 'set_status_format' method to set the attribute it wants to access if it is not already set. * Adding tests for Cryostream and Cryostream Adapter * Make pydocstyle complient * Use absolute difference to compare gas and target temperature * Refactoring and rewriting test * Change to 'margin of error' style test * Add comments * Improve test coverage of CryostreamBase * Refactoring of attribute and improvements 'set_current' docstring. Renamed _current attribute to _output_current to better reflect it's interpretation. Improved the docstring for the 'set_current' message. Before it seemed like the 'current' parameter would be stored in the class' current attribute. Whereas in fact the input parameter is multiplied by the 'gain' of the device first. * Add tests for the femto class * Add tests for Pneumatic and PneumaticAdapter * Rename file and increase test coverage to 100% * Remove unused imports * Remove git merging artifacts * Remove more git merge artifacts * Improvements to tests for CryostreamBase * Improve tests by using 'await' instead of 'asyncio.run' * Fix broken test * Add tests for EpicsAdapter * Add attribute in test rather than change class * Disable eq to make dataclass InputRecord hashable This is required to be able to use InputRecords as a key to a dict. * Fix lack of awaiting Co-authored-by: Garry O'Donnell <[email protected]> * Clean commented out code * Make flake8 complient * Freeze dataclass instead of removing __eq__ * Remove trailing '0' from conditional in CryostreamBase.ramp A seeming flaw in the logic for ramp where it was impossible to set the gas flow to anything other than 10 was the result of a trailing 0 on the number 9000. * Change tests for ramp to reflect changes to that method * Update tests to reflect changes to 'ramp' method * Make the mocking of softioc explicitly apply to the entire test suite. Move the mocking of softioc to tests/conftest.py where it will explicitly apply to all test. Mark femto as xfail for now. We know it works in isolation but we need to figure out how to get it working when run along with the other tests. * Remove outdated comment * Add typehint * Patch all softioc methods * Remove mocking of softioc module * Undo Garry's meddling * Refactor for flake8 complience * Make test skip and add an explaination for the future * Remove redundant 'xfail' * Undo pointless tinkering * Extract method from 'build_ioc' * Test extracted method instead of old method * Have mock cryostream get status return correct mock status * Use assert_awaited for coroutines * Change test to suppress asyncio warning * Revert "Change test to suppress asyncio warning" This reverts commit e085798d3dc729bb14dba0a067d3142abb13ac90. * Fix CLI tests by mocking tickit.cli.run_all_forever * Add tests for Source and Sink devices * Add device and system simulation tests * Remove merging artifacts * Mock state producer and consumer * Declump tests * Separate testable logic into another function * Add tests for TcpServer * Rename fixture and tweak the test to attempt to improve coverage. * Add docstring to "generate_handle_function" * Add "asyncio.streams" classes to nitpick_ignore list. The documentation for these classes was built with an out-of-date version of Sphinx which may have caused them to become unavailable via the intersphinx extension. * Enhance test with more assertions * Enhance test with more assertions * Enhance tests with more assertions * Remove unintensional commenting-out of theme setting. That setting does not work locally and that change got committed accidentally. * Add tests for BaseScheduler * Refactor for easier testing * [WIP] Adding tests for MasterScheduler I'm going to need these files at work next week so don't panic if they break CI okay? ;) * Add docstrings * Substitute set comprehension for list to preserve order * Add working tests for multiple methods of MasterScheduler * Remove unneccessary imports * Change test to reflect the changes made in #16 * Update system simulation tests * Update tests for Sink device Changes to how sink object are intantiated calls for updates to these tests. * Update to tests for Source device Updates to how Source devices are instantiated requires that these tests be updated. * Add 'Optional' to typing as required by 'mypy' The origins of this error are unknown but it is a trivial change which can be included with this PR. * Add tests for 'SlaveScheduler' * Rename fixtures * Split tests for handling interrupt and output messages. * Rename fixtures * Changes to 'MasterScheduler' and tests * Change name of '_run_tick' to '_do_tick' * Moved call to 'setup' from '_do_initial_tick' to 'run_forever' * Added test for successful scheduling of interrupts while there are queued wakeups * Mollify MyPy errors * Replace 'Internal' state interfaces with base classes * Remove commented-out code * Enhance testing of logging call * Make 'generage_handle_function' "private 😏" * Remove the '_TestBaseScheduler' class and use 'patch.object' instead * Fix Cli tests for 'skip-lock' installations * Fix Cli tests for 'skip-lock' installations * Add tests for 'loading.py' * Change to reading 'current-monitor.yaml' to avoid import errors. * Refactor 'run_forever' into an instance method * Add tests for 'KafkaStateConsumer/Producer' * Test byte format (#38) * Added tests for ByteFormat * Remove concrete classes in favour of Mocks * Make 'run_forever' method "private" Co-authored-by: O'Donnell, Garry (DLSLtd,RAL,LSCI) <garry.o'[email protected]> Co-authored-by: O'Donnell, Garry (DLSLtd,RAL,LSCI) <[email protected]> Co-authored-by: Ollie Copping <[email protected]> Co-authored-by: Garry O'Donnell <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #14 .