-
Notifications
You must be signed in to change notification settings - Fork 110
Updates/orbital elements #1047
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
Updates/orbital elements #1047
Conversation
LourensVeen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but I have a few questions. Let's discuss.
|
|
||
| def initialize(self, radii, densities, core_radius = None): | ||
| self.sort_density_and_radius(densities*1.0, radii*1.0, core_radius = core_radius) | ||
| self.four_thirds_pi = numpy.pi * 4.0 / 3.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could (should, but not necessarily in this PR) be a module-level constant rather than a member variable.
| return (self.enclosed_mass[index] + self.four_thirds_pi * | ||
| self.densities[index] * (radius**3 - self.radii_cubed[index])) | ||
|
|
||
| return self.enclosed_mass[index] + self.four_thirds_pi * self.densities[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, that's not an improvement, but if this is what black makes of it then it is what it is...
| [tool.setuptools_scm] | ||
| write_to = "src/amuse/version.py" | ||
|
|
||
| [flake8] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The black documentation says it uses [tool.black]? Or are we using flake8 here? I'm confused.
|
|
||
| from optparse import OptionParser | ||
|
|
||
| # Should probably use an absolute import here (support.config), but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will probably get fixed with the new build system, as we're not running amusifier anymore as part of the installation process. But that change belongs with that PR.
Fixes to orbital_elements.py, allow orbital elements to be returned as a dictionary for clarity