Skip to content

Multiple scan XY API Change#51

Open
CSSFrancis wants to merge 11 commits intodirectelectron:mainfrom
CSSFrancis:multiple-scans
Open

Multiple scan XY API Change#51
CSSFrancis wants to merge 11 commits intodirectelectron:mainfrom
CSSFrancis:multiple-scans

Conversation

@CSSFrancis
Copy link
Copy Markdown
Member

This pull request introduces several improvements and bug fixes to the deapi client and its test suite. The most significant changes are focused on enhancing the flexibility and robustness of scan pattern handling, improving test reliability and performance, and refining property and acquisition management. Below is a summary of the most important changes, grouped by theme.

Scan Pattern Handling and Client Improvements:

  • Enhanced set_xy_array in deapi/client.py to support lists of numpy arrays, handle both 2D and 3D input, ensure integer types, validate shapes, and correctly compute scan dimensions. This improves flexibility and error handling for scan pattern input.
  • Modified the property setter to convert boolean values to "On"/"Off" strings, ensuring consistent property value handling.
  • Changed the default pixel_format in get_result to "AUTO" for better compatibility.

Test Suite Reliability and Performance:

  • Updated test fixtures to use scope="session" for the client fixture, reducing setup/teardown overhead and improving test performance.
  • Removed unnecessary time.sleep calls and replaced them with more robust idle-waiting logic (e.g., wait_for_idle(client)), leading to more reliable and faster tests. [1] [2] [3]
  • Set up a consistent initial state in test fixtures and removed redundant property assignments from individual tests. [1] [2]

Test Coverage and Robustness:

  • Added additional property setting and validation in tests, such as explicitly setting hardware binning before testing software binning options, to ensure test correctness. [1] [2]
  • Updated scan and acquisition tests to use more appropriate parameter values and improved error handling for edge cases. [1] [2]

File Saving and Loading Tests:

  • Marked slow or unreliable tests with @pytest.mark.skip(reason="Slow and broken") to improve test suite reliability and focus on stable tests. [1] [2]
  • Moved import of libertem.api into the test function to avoid unnecessary imports and potential issues when the library is not available.

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.

1 participant