Skip to content

Use jax.Array consistently for typing - #192

Open
mscroggs wants to merge 11 commits into
mainfrom
mscroggs/jaxArray
Open

Use jax.Array consistently for typing#192
mscroggs wants to merge 11 commits into
mainfrom
mscroggs/jaxArray

Conversation

@mscroggs

@mscroggs mscroggs commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Resolves #155

Comment thread src/causalprog/algorithms/moments.py Outdated
Comment thread src/causalprog/solvers/sgd.py Outdated
@@ -158,8 +157,8 @@ def f_y(x_uy: dict[str, NDArray], theta_y: ModelParam) -> float | NDArray:
c_values = node_c.possible_values

def _integrand(
s_q: float, xzl: dict[str, NDArray], model_params: dict[str, ModelParam]
) -> float | NDArray:
s_q: float, xzl: dict[str, jax.Array], model_params: dict[str, ModelParam]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
s_q: float, xzl: dict[str, jax.Array], model_params: dict[str, ModelParam]
s_q: float, xzl: dict[str, jax.Array], model_params: ModelParam

Looking at it now, should all this model_params be define as ModelParam or equivalently dict[str, Jax.Array]?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's still a few dict[str, ModelParam] types in this PR. I'm uncertain if they're what we want or not

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've opened #215 for this typing issue. Suggest we merge this then leave sorting out ModelParam typing for the future

Co-authored-by: Sam Molyneux <samjmolyneux@gmail.com>
Comment thread src/causalprog/algorithms/evaluate.py Outdated
@mscroggs mscroggs added the help wanted Extra attention is needed label Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standardise NDArray type hints

2 participants