Skip to content

Commit

Permalink
add auxiliary field to dlx.Model
Browse files Browse the repository at this point in the history
  • Loading branch information
pfackeldey committed Nov 24, 2023
1 parent b0c2e70 commit e2aa07a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/dilax/model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

import abc
from typing import TYPE_CHECKING, cast
from typing import TYPE_CHECKING, Any, cast

import equinox as eqx
import jax
Expand Down Expand Up @@ -96,10 +96,19 @@ def eval(model) -> jax.Array:

processes: dict
parameters: dict[str, Parameter]
auxiliary: Any

def __init__(self, processes: dict, parameters: dict[str, Parameter]) -> None:
def __init__(
self,
processes: dict,
parameters: dict[str, Parameter],
auxiliary: Any | Sentinel = _NoValue,
) -> None:
self.processes = processes
self.parameters = parameters
if auxiliary is _NoValue:
auxiliary = {}
self.auxiliary = auxiliary

@property
def parameter_values(self) -> dict[str, jax.Array]:
Expand Down

0 comments on commit e2aa07a

Please sign in to comment.