stefmolin / data-morph

Morph an input dataset of 2D points into select shapes, while preserving the summary statistics to a given number of decimal points through simulated annealing. It is intended to be used as a teaching tool to illustrate the importance of data visualization.
https://stefaniemolin.com/data-morph/
MIT License
60 stars 16 forks source link

Optimize generator expression in `circles.py` #202

Closed JCGoran closed 1 month ago

JCGoran commented 1 month ago

Is your feature request related to a problem? Please describe.

This line of code:

https://github.com/stefmolin/data-morph/blob/980b16732719608e6192bba39badaf4b0fa4d293/src/data_morph/shapes/circles.py#L153

could probably be optimized into something numpy-ish to not be sequential but vectorized.

Describe the solution you'd like

Convert it to numpy.

Describe alternatives you've considered

None.

Additional context

None.