Add Class¶
Create a new class to implement the feature.
This is typically a wrapper around the functions you wrote in the previous step.
Choose a base¶
BuilderABC– when key/parameter checking is useful.dataclass– for simple, immutable data containers.- Regular class – for everything else.
Required Sections¶
__init__with complete type hints.- Public interface first (getters, setters, actions).
- Docstring that includes an “Examples” subsection.
- Follow Code Specifications for formatting.
Steps¶
- Create a new issue on GitHub and assign it to yourself.
- Create a branch on your forked repo for this issue.
- Add a new class(s) to the appropriate module in particula//.
- If the module is new, add it to
__init__.py. - Use
ABCfor abstract classes andBuilderABCfor builders. - Call your functions in the class methods and keep most calculations in the functions (not directly in the class).
- Write a docstring.
- Add type hints for all parameters and return values.
- Add unit tests for the class (see Add Unit Tests).
- Commit this file in a branch.
- Create your pull‑request to the main repo.