Skip to content
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

Improve simulator functionality #249

Conversation

Modularius
Copy link
Contributor

Summary of changes

  1. Changed unwraps to expects in build_messages.rs
  2. Changed send_trace_message to send_digitiser_trace_message and integrated edits in send_messages.rs, simulation.rs, engine.rs and others.
  3. Added Trace struct for channel traces in event_lists.rs and refactored
  4. Added IntConstant and TextConstant types
  5. Added EnsureDelayMs action
  6. Improved error handling

Instruction for review/testing

General code review as the simulator was successfully tested in the pipeline.

@Modularius Modularius requested a review from DanNixon September 5, 2024 11:22
Copy link
Member

@DanNixon DanNixon left a comment

Choose a reason for hiding this comment

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

I don't like the amount of unwrap and expect. Now that we have a standard for how error handling should happen I would like new and refactored code to use it (arguably it is of less concern for the simulator but I see a lot of the same elsewhere, anything related to tracing for example).

@Modularius
Copy link
Contributor Author

Modularius commented Sep 6, 2024

There were considerably more unwraps than I realised. I've replaced them with anyhows (they inform the user of invalid JSON), and all remaining excepts should be impossible. The remaining unwraps are all part of test modules.

@Modularius Modularius requested a review from DanNixon September 6, 2024 11:06
@DanNixon
Copy link
Member

DanNixon commented Sep 6, 2024

I've replaced them with anyhows (they inform the user of invalid JSON)

See https://github.com/STFC-ICD-Research-and-Design/supermusr-data-pipeline/blob/main/docs/style.md#crab-error-handling-rules, anyhow outside of the return type of main() is prohibited.

@DanNixon DanNixon merged commit 88e4cc0 into STFC-ICD-Research-and-Design:main Sep 10, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants