Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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.

src/amuse/units/constants.py Show resolved Hide resolved

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.

src/amuse/ext/orbital_elements.py Show resolved Hide resolved
src/amuse/ext/orbital_elements.py Show resolved Hide resolved
@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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.