Skip to content

Typehints

Description

I'm adding type hints to most of the mbtrack2 modules. This helps at least with the autocompletion of code. We can also add Pyright or some other type checker in the CI/CD.

Also, I removed the IonAperture class because it is too similar to normal apertures. All apertures now inherit from a general Aperture class and all of them have a boolean flag delete_particles. If it's true the Aperture behaves like an IonAperture (deleting out-of-bounds particles)

Types of changes

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply) -> typos only

Related Issue

The merge request solves the following issues

  • Aperture # (#20)
  • Typehints # (#19)

Tests

Please describe the tests that you ran to verify your changes. Tests should be runnable automatically via pytest.

  • mbtrack2 unit tests
  • mbtrack2 physics tests

Checklist:

Go over all the following points, and put an x in all the boxes that apply. If you're unsure about any of these, don't hesitate to ask. We're here to help!

  • I have performed a self-review of my own code
  • Code is formatted properly with yapf and isort
  • Code follows the style guidelines of this project
  • Code is commented where appropriate
  • Documentation is updated with the newest changes
  • My changes generate no new warnings
  • Tests for the new feature were added, and they pass
  • New and existing unit tests pass locally with new changes
Edited by Vadim GUBAIDULIN

Merge request reports

Loading