jorgepiloto / lamberthub

A set of Lambert's problem solvers
GNU General Public License v3.0
47 stars 5 forks source link

Replace assertions by custom exceptions #39

Open jorgepiloto opened 3 years ago

jorgepiloto commented 3 years ago

💻 Feature request: replace assertions by custom exceptions

In most of the solvers, different assertions regarding the validity of the parameters, the convergence to a given accuracy and others are executed. Assertions should only be applied within the tests/ directory. Instead, we must create custom exceptions and raise those, for example: IterationsError, AtolError, RevolutionsError, RtolError, InputError, TransferAngleError.

📝 References

This talks by Mario Corchero titled "Exceptional Exceptions" will be super useful!

  1. https://www.youtube.com/watch?v=f3UoZU3hK-c
  2. https://www.youtube.com/watch?v=V2fGAv2R5j8
jorgepiloto commented 3 years ago

A color scheme needs to be defined for each one of those errors, so they can be tracked in the IterationsPlotter.