Skip to content

ENH: real and complex dtype functions #13

@izaid

Description

@izaid

Hello! Very excited about this library, as it (hopefully) provides a place to put functions that are array agnostic and usable by many people. Let me describe two simple ones that I'd like to make a PR for.

I'd like to add functions real_type(dtype) and complex_type(dtype). These are simple:

  • real_type takes in a real or complex dtype, and returns the corresponding floating-point dtype. So complex128 -> float64, complex64 -> float32, float64 -> float64, float32 -> float32.
  • complex_type takes in a real or complex dtype, and returns the corresponding complex floating-point dtype. So float64 -> complex128, float32 -> complex64, complex128 -> complex128, complex64 -> complex64.

This can be really helpful in application code to work out the correct types. Shall I make a PR for these?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy