Skip to content

DRAFT: Vectorize & Optimize Coordinate Conversion Functions - #546

Closed
philipc2 wants to merge 6 commits into
mainfrom
philipc2/vectorize-optimize-coord
Closed

philipc2 wants to merge 6 commits into
mainfrom
philipc2/vectorize-optimize-coord

Conversation

@philipc2

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


@njit(cache=ENABLE_JIT_CACHE)
def normalize_in_place(node):

Copy link
Copy Markdown
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.

Comment thread uxarray/grid/coordinates.py Outdated
#@njit(cache=ENABLE_JIT_CACHE)
def normalize_in_place(coords):

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

Copy link
Copy Markdown
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
Copy Markdown
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 :)

@hongyuchen1030 hongyuchen1030 mentioned this pull request Oct 31, 2023
10 tasks done
@philipc2 philipc2 changed the title DRAFT: Vectorize & Optimize Coordinate Connectivity Functions DRAFT: Vectorize & Optimize Coordinate Conversion Functions Oct 31, 2023
@philipc2

Copy link
Copy Markdown
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
@erogluorhan
erogluorhan deleted the philipc2/vectorize-optimize-coord branch December 2, 2024 16:22
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