[Numpy-discussion] New Feature added to rotate MeshGrid

2021-08-31 Thread Yash Tewatia
Hi, it is my first contribution to the open-source community, I have tried
to fix issue #19315, which is to add a new feature of rotating mesh grid in
NumPy. It would be great if I get improvements and suggestions for it.

Added functionality of rotating mesh grid which fixes #19315 issue, adds a
feature which works as follows
Parameters
---
xspan : Input_array
  range of values of x in the unrotated matrix.
yspan : Input_array
  range of values of y in the unrotated matrix.
angle : float or int
  Angle of rotation, positive for clockwise rotation, negative for
anti-clockwise rotation.
boolRad : bool
True if the given angle is in Radians, False if given angle is
in Degrees.
Returns

out : ndarray
A new nested array is generated by Einstein Summation after
rotation is applied.

Examples
--
>>> xspan = np.linspace(-2*np.pi, 2*np.pi, 3)
>>> yspan = np.linspace(-2*np.pi, 2*np.pi, 3)
>>> arr = np.rotateMeshgrid(xspan,yspan,0.4)
>>> arr
array([[[-6.32689674, -0.04386455,  6.23916764],
[-6.28303219,  0.,  6.28303219],
[-6.23916764,  0.04386455,  6.32689674]],

   [[-6.23916764, -6.28303219, -6.32689674],
[ 0.04386455,  0., -0.04386455],
[ 6.32689674,  6.28303219,  6.23916764]]])

>>> arr = np.rotateMeshgrid(xspan,yspan,80,False)
>>> arr
array([[[ 6.9383701 ,  6.24478659,  5.55120308],
[ 0.69358351,  0., -0.69358351],
[-5.55120308, -6.24478659, -6.9383701 ]],

   [[-5.55120308,  0.69358351,  6.9383701 ],
[-6.24478659,  0.,  6.24478659],
[-6.9383701 , -0.69358351,  5.55120308]]])

Code snippet:
(
https://user-images.githubusercontent.com/60055574/131483810-05012ab1-8971-4a94-8b1c-8f11d13b7c02.png
)
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] New Feature added to rotate MeshGrid

2021-08-31 Thread Ralf Gommers
On Tue, Aug 31, 2021 at 12:07 PM Yash Tewatia  wrote:

> Hi, it is my first contribution to the open-source community, I have tried
> to fix issue #19315, which is to add a new feature of rotating mesh grid in
> NumPy. It would be great if I get improvements and suggestions for it.
>

Hi Yash, welcome!

That issue is a feature request that did not get a response yet. It seems
to me like we should reject it, because rotating a grid is a fairly easy
thing to do, as the Stack Overflow discussion linked from
https://github.com/numpy/numpy/issues/19315 shows.

Cheers,
Ralf



> Added functionality of rotating mesh grid which fixes #19315 issue, adds a
> feature which works as follows
> Parameters
> ---
> xspan : Input_array
>   range of values of x in the unrotated matrix.
> yspan : Input_array
>   range of values of y in the unrotated matrix.
> angle : float or int
>   Angle of rotation, positive for clockwise rotation, negative for
> anti-clockwise rotation.
> boolRad : bool
> True if the given angle is in Radians, False if given angle is
> in Degrees.
> Returns
> 
> out : ndarray
> A new nested array is generated by Einstein Summation after
> rotation is applied.
>
> Examples
> --
> >>> xspan = np.linspace(-2*np.pi, 2*np.pi, 3)
> >>> yspan = np.linspace(-2*np.pi, 2*np.pi, 3)
> >>> arr = np.rotateMeshgrid(xspan,yspan,0.4)
> >>> arr
> array([[[-6.32689674, -0.04386455,  6.23916764],
> [-6.28303219,  0.,  6.28303219],
> [-6.23916764,  0.04386455,  6.32689674]],
>
>[[-6.23916764, -6.28303219, -6.32689674],
> [ 0.04386455,  0., -0.04386455],
> [ 6.32689674,  6.28303219,  6.23916764]]])
>
> >>> arr = np.rotateMeshgrid(xspan,yspan,80,False)
> >>> arr
> array([[[ 6.9383701 ,  6.24478659,  5.55120308],
> [ 0.69358351,  0., -0.69358351],
> [-5.55120308, -6.24478659, -6.9383701 ]],
>
>[[-5.55120308,  0.69358351,  6.9383701 ],
> [-6.24478659,  0.,  6.24478659],
> [-6.9383701 , -0.69358351,  5.55120308]]])
>
> Code snippet:
> (
> https://user-images.githubusercontent.com/60055574/131483810-05012ab1-8971-4a94-8b1c-8f11d13b7c02.png
> )
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] New CZI grant to support DEI initiatives in the scientific Python ecosystem

2021-08-31 Thread Melissa Mendonça
We are happy to announce the Chan Zuckerberg Initiative has awarded a grant
to support the onboarding, inclusion, and retention of people from
historically marginalized groups on scientific Python projects, and to
structurally improve the community dynamics for NumPy, SciPy, Matplotlib,
and Pandas.

As a part of CZI’s Essential Open Source Software for Science program [1],
this Diversity & Inclusion supplemental grant [2] will support the creation
of dedicated Contributor Experience Lead positions to identify, document,
and implement practices to foster inclusive open-source communities. This
project will be led by Melissa Mendonça (NumPy), with additional mentorship
and guidance provided by Ralf Gommers (NumPy, SciPy), Hannah Aizenman and
Thomas Caswell (Matplotlib), Matt Haberland (SciPy), and Joris Van den
Bossche (Pandas).

This is an ambitious project aiming to discover and implement activities
that should structurally improve the community dynamics of our projects. By
establishing these new cross-project roles, we hope to introduce a new
collaboration model to the Scientific Python communities, allowing
community-building work within the ecosystem to be done more efficiently
and with greater outcomes. We also expect to develop a clearer picture of
what works and what doesn’t in our projects to engage and retain new
contributors, especially from historically underrepresented groups.
Finally, we plan on producing detailed reports on the actions executed,
explaining how they have impacted our projects in terms of representation
and interaction with our communities.

The two-year project is expected to start by November 2021, and we are
excited to see the results from this work! You can read the full proposal
in figshare [3] and see this announcement at the NumPy site [4].

Cheers!

- Melissa

[1] https://chanzuckerberg.com/eoss/
[2]
https://cziscience.medium.com/advancing-diversity-and-inclusion-in-scientific-open-source-eaabe6a5488b
[3]
https://figshare.com/articles/online_resource/Advancing_an_inclusive_culture_in_the_scientific_Python_ecosystem/16548063
[4]
https://numpy.org/news/#advancing-an-inclusive-culture-in-the-scientific-python-ecosystem
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion