Type Definitions

This module defines type aliases and protocols used throughout the package.

Type Aliases

microscopic_gating.types.ArrayLike

Type alias for array-like inputs (numpy arrays, lists, or scalars).

Protocols

class microscopic_gating.types.Isotherm(*args, **kwargs)[source]

Bases: Protocol

Protocol for adsorption isotherms.

Any class implementing this protocol can be used with the gating models, allowing flexible substitution of different adsorption models.

theta(phi)[source]

Calculate occupancy fraction.

Parameters:

phi (ArrayLike) – Bulk concentration.

Returns:

theta – Occupancy fraction in [0, 1], same shape as phi.

Return type:

ArrayLike

__init__(*args, **kwargs)
class microscopic_gating.types.ContactProbability(*args, **kwargs)[source]

Bases: Protocol

Protocol for contact/capture geometry factors.

Implementations provide the mean contact probability <chi> that accounts for geometric constraints on bridge formation.

mean_contact()[source]

Return the mean contact probability.

Returns:

chi_mean – Mean contact probability <chi> in [0, 1].

Return type:

float

__init__(*args, **kwargs)

Data Classes

class microscopic_gating.types.SitePairCount(M, N_acc)[source]

Bases: object

Number of potentially accessible site pairs.

This dataclass encapsulates the combinatorial factor for bridge formation based on available binding sites.

Parameters:
  • M (int) – Number of binding sites on the particle.

  • N_acc (int) – Number of accessible binding sites on the network (geometry-dependent).

N_pair

Total site pair count, calculated as M * N_acc.

Type:

int

Examples

>>> site_pairs = SitePairCount(M=10, N_acc=5)
>>> site_pairs.N_pair
50
M: int
N_acc: int
__init__(M, N_acc)
Parameters:
Return type:

None

Type Hierarchy

The type system is designed for flexibility:

  • ArrayLike - Any array-like input (numpy arrays, lists, scalars)

  • Isotherm - Protocol for any object with a theta(phi) method

  • ContactProbability - Protocol for geometry factors

This allows easy extension with custom isotherms or geometry models.