Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Make DEFAULT_NUM_PARTICLES/DEFAULT_STATIC_NUM_PARTICLES settable #84

Open
jonniedie opened this issue Jul 15, 2020 · 3 comments

Comments

@jonniedie
Copy link

It would be nice to be able to set the default number of particles for .., ±, and .

@baggepinnen
Copy link
Owner

This was possible at one point, but it had a serious drawback; since the number of particles is part of the type specification, all constructors using the default number would be type unstable, resulting in terrible performance. Currently, the recommended approach is simply to override the operators with a custom implementation, or create a helper function that creates teh desired kind of particles. If you have any ideas on how to improve this situation, I'm happy to discuss :)

@jonniedie
Copy link
Author

Ah, I didn't think about constructor performance because I almost always use ± and .. outside of the performance-critical parts of the code (I just use it for inputs, mostly). But that makes sense. I've been going the operator overload approach, which is fine too.

@baggepinnen
Copy link
Owner

This could possibly be addressed by the "preferences" feature in the upcoming Julia 1.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants