Skip to content

Pilot GSM functions to also operate on arrays #4

@aufdenkampe

Description

@aufdenkampe

All modeling software that use these modules will need them computed over arrays of values.

The decision to first get these modules working correctly with scalars (i.e. a single value) was wise, because Fortran and C++ have lots of additional code to deal with arrays that could have substantially complicated refactoring.

Fortunately, scientific Python makes it very simple to "vectorize" calculations from single value calculations to calculations over arrays of values, which speeds up calculations 8000 times with very little change in coding. The standard for “vectorized” operations in Python uses the NumPy Library, but many Python libraries provide such functionality (including Xarray and Dask), and a Python Array API Standard in being developed.

As a pilot for "vectorizing" this package, let's start by modifying functions in GSM to accept and operate on either a single value float or an array of floats.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions