Skip to content

Rewrite Geometry Functions With Latest Refractors #880

Closed

Description

@hongyuchen1030

Proposed new feature or change:

Summary

As discussed thoroughly in #785, many of the geometry functions were implemented before multiple refactors and changes to data structures, and they have not been updated to align with the current implementation. A rewrite is needed to significantly improve performance.

Affected Geometry Functions

The following geometry functions are in need of a rewrite:

  • _pole_point_inside_polygon
  • extreme_gca_latitude
  • _insert_pt_in_latlonbox
  • _get_cartesian_face_edge_nodes
  • _get_lonlat_rad_face_edge_nodes

Key Issues

To improve performance, we need to eliminate any unnecessary coordinate conversion calls, such as _xyz_to_lonlat_rad.

One proposed solution is to provide both the latlon_rad and cartesian points in the function call to avoid needing conversions. For example:

def _point_within_gca(pt_latlon,
                      pt_xyz,
                      gca_a_latlon,
                      gca_a_xyz,
                      gca_b_latlon,
                      gca_b_xyz,
                      is_directed=False):

Request

A new API design is required for these geometry functions to address the issues mentioned and enhance performance.

Activity

  1. added
    new feature
    improvement
    scalability
    on Aug 9, 2024
  2. philipc2 commented on Mar 18, 2025

    @philipc2
    Member

    @hongyuchen1030

    Should we link this with #1180

  3. moved this from 📚 Backlog to 📝 To-Do in UXarray Developmenton Mar 18, 2025
  4. hongyuchen1030 commented on Mar 18, 2025

    @hongyuchen1030
    ContributorAuthor

    @hongyuchen1030

    Should we link this with #1180

    Hmmm so technically we can. But when I was checking the current implementation, lots of the goals here have already been achieved. So I think we can either directly close it or link this with #1180

  5. erogluorhan commented on Jun 13, 2025

    @erogluorhan
    Member

    Closing per @hongyuchen1030 's previous comment here. Can reopen if we need.

  6. moved this from 📝 To-Do to ✅ Done in UXarray Developmenton Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

improvementnew featurescalability

Type

No type

Fields

Priority

None yet

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions