Skip to content

util

get_implementations(f)

Returns the implemented type signatures for an operator.

Parameters:

Name Type Description Default
f

An operator function registered via @operator.

required

Returns:

Type Description

list[tuple[str, ...]]: List of type signature tuples for each

implementation.

Example

from jaxdf.operators import gradient get_implementations(gradient) [('Continuous',), ('FiniteDifferences',), ('FourierSeries',)]

get_implemented(f)

Prints the implemented methods of an operator

Parameters:

Name Type Description Default
f Callable

The operator to get the implemented methods of.

required

Returns:

Type Description

None

has_implementation(f, *types)

Check if an operator has an implementation for the given types.

Parameters:

Name Type Description Default
f

An operator function registered via @operator.

required
*types

The types to check for.

()

Returns:

Name Type Description
bool

True if an implementation exists for the given types.

Example

from jaxdf.operators import gradient from jaxdf.discretization import FourierSeries has_implementation(gradient, FourierSeries) True

update_dictionary(old, new_entries)

Update a dictionary with new entries.

Parameters:

Name Type Description Default
old dict

The dictionary to update

required
new_entries dict

The new entries to add to the dictionary

required

Returns:

Name Type Description
dict

The updated dictionary