Skip to content

Conversation

@rieder
Copy link
Member

@rieder rieder commented Apr 23, 2024

Fixes to orbital_elements.py, allow orbital elements to be returned as a dictionary for clarity

@rieder rieder marked this pull request as ready for review April 23, 2024 21:42
@rieder rieder requested a review from a team as a code owner April 23, 2024 21:42
Copy link
Member

@LourensVeen LourensVeen left a 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
Copy link
Member

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[
Copy link
Member

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]
Copy link
Member

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
Copy link
Member

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.

@rieder rieder merged commit 6eb2ab3 into main Apr 24, 2024
@rieder rieder deleted the updates/orbital_elements branch April 24, 2024 13:50
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

Successfully merging this pull request may close these issues.

3 participants