There is still some functionality decorated with @u.quantity_input that should be decorated with @validate_quantities instead.
I could take a crack at this if no one else is. Just let me know and I'll get started!
No one is working on it at the moment, so have at it! Thanks. Let us know if you need any guidance. You can find the documentation on validate_quantities here.
@rocco8773 Sounds great, thank you!
Hey @rocco8773 , sorry it's taken so long for me to get on this. I have a quick question about the uses of @u.quantity_input in the code as it sits currently,
In the cases where functions are decorated with @u.quantity_input with out any arguments, can the decoration be replaced directly with @validate_quantities, or are there specific arguments that need to be passed in those cases? An example from plasmapy/particles/ionization_state.py line 400:
@property
@u.quantity_input
def n_e(self) -> u.m ** -3:
"""
Return the electron number density assuming a single species
plasma.
"""
return np.sum(self._n_elem * self.ionic_fractions * self.integer_charges)
Edit: line breaks didn't copy properly, but I think you get the idea of what I'm asking :)
@wskinner74 No worries. Yes, in that case you should just be able to make a direct replacement.
Edit: line breaks didn't copy properly, but I think you get the idea of what I'm asking :)
Take a look at the edit I made to your comment. For multi-line code blocks you need to wrap it in triple-`. Check out GitHub's Markdown primer.
Ok good to know, thanks!
Alright, I've changed decorators to @validate_quantities, but I didn't change the arguments passed to it. From what I can tell reviewing the docs, I think it should work this way. I'm not sure if I'm either trying to overcomplicate a simple solution, or if I'm oversimplifying a complex solution.
Building with pip3 install . works, but I'm not sure if that validates the functions or not. Are there any test cases I can try to ensure that it's working? Otherwise, I can send a pull request for review.
We do have a testing guide in the docs; but it's simplest if you just send the PR in, and the full test suite will run on that automatically :)
@StanczakDominik Sounds great, thank you.