Skip to content

The inner function inside the function 'moon_nodes' has an incorrect docstring. #1133

@Gianno-22

Description

@Gianno-22

Description

The inner function moon_node_at() inside moon_nodes() appears to have an incorrect docstring.

Current code:

def moon_node_at(t):

"""Return the phase of the moon 0 through 3 at time `t`."""

e = earth.at(t)
lat, _, _ = e.observe(moon).apparent().frame_latlon(ecliptic_frame)
return lat.radians > 0.0

The function returns:

lat.radians > 0.0

which evaluates to a boolean:

  • True -> Moon above the ecliptic
  • False -> Moon below the ecliptic

It does not return moon phases 0–3.

Suggested Change

The docstring should describe the actual behavior, for example:

"""Return True if the Moon is above the ecliptic, else False."""

Additional Notes

The current docstring seems to have been copied from moon_phase_at() inside moon_phases():

def moon_phase_at(t):

"""Return the phase of the moon 0 through 3 at time `t`."""

This may confuse new users because they might expect moon_nodes() to return phase values instead of boolean values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions