Skip to content
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

DRAFT: Vectorize & Optimize Coordinate Conversion Functions #546

Closed
wants to merge 6 commits into from

Conversation

philipc2
Copy link
Member

Closes #XXX

Overview

Expected Usage

import uxarray as ux

grid_path = "/path/to/grid.nc"
data_path = "/path/to/data.nc"

uxds = ux.open_dataset(grid_path, data_path)

# this is how you use this function
some_output = uxds.some_function()

# this is another way to use this function
other_output = uxds.some_function(some_param = True)

PR Checklist

General

  • An issue is linked created and linked
  • Add appropriate labels
  • Filled out Overview and Expected Usage (if applicable) sections

Testing

  • Adequate tests are created if there is new functionality
  • Tests cover all possible logical paths in your function
  • Tests are not too basic (such as simply calling a function and nothing else)

Documentation

  • Docstrings have been added to all new functions
  • Docstrings have updated with any function changes
  • Internal functions have a preceding underscore (_) and have been added to docs/internal_api/index.rst
  • User functions have been added to docs/user_api/index.rst

Examples

  • Any new notebook examples added to docs/examples/ folder
  • Clear the output of all cells before committing
  • New notebook files added to docs/examples.rst toctree
  • New notebook files added to new entry in docs/gallery.yml with appropriate thumbnail photo in docs/_static/thumbnails/

@philipc2 philipc2 linked an issue Oct 25, 2023 that may be closed by this pull request
@philipc2 philipc2 self-assigned this Oct 25, 2023
@@ -83,40 +88,75 @@ def node_xyz_to_lonlat_rad(node_coord):
return [d_lon_rad, d_lat_rad]


@njit(cache=ENABLE_JIT_CACHE)
def normalize_in_place(node):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another issue #346 where the requirement is node be a numpy array. It'd be good to tackle both together. It has to be done carefully as it breaks numba compatibility.

#@njit(cache=ENABLE_JIT_CACHE)
def normalize_in_place(coords):

coords_norm = coords / np.linalg.norm(coords, ord=2, axis=1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have started a branch with similar WIP code - here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look at this! This branch right here is just a few ideas tossed together for now :)

@philipc2 philipc2 changed the title DRAFT: Vectorize & Optimize Coordinate Connectivity Functions DRAFT: Vectorize & Optimize Coordinate Conversion Functions Oct 31, 2023
@philipc2
Copy link
Member Author

Closing this PR as it's become stale, will revisit the implementation in a new PR

@philipc2 philipc2 closed this Mar 19, 2024
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.

2 participants