Skip to content

CI for main and small fixes#11

Merged
flxrcz merged 2 commits intomainfrom
dev
Nov 7, 2025
Merged

CI for main and small fixes#11
flxrcz merged 2 commits intomainfrom
dev

Conversation

@flxrcz
Copy link
Copy Markdown
Collaborator

@flxrcz flxrcz commented Nov 7, 2025

Adds CI to main and merges to be done on main, i.e. run tests on new merge requests.
Additionally the banana example is extended

@flxrcz flxrcz requested a review from Copilot November 7, 2025 13:59
@flxrcz flxrcz merged commit 5b70bb0 into main Nov 7, 2025
9 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds CI workflow configuration, updates linter rules for example files, and refactors the banana model example to use the DifferentiableMCMCModel base class with gradient computation.

  • Adds a new GitHub Actions CI workflow for format checking, documentation building, and testing
  • Configures Ruff linter to ignore specific rules for example files
  • Updates the banana model example with type hints and gradient implementation

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
pyproject.toml Adds per-file ignores for examples directory to relax linting requirements
examples/model_banana_2D.py Refactors to use DifferentiableMCMCModel, adds gradient method and type hints
.github/workflows/ci.yml Adds new CI workflow for automated testing and validation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml
]
pydocstyle.convention = "google"
per-file-ignores = { "test/*" = ["D100", "D102", "D103", "D107", "INP001", "N802"] }
per-file-ignores = { "test/*" = ["D100", "D102", "D103", "D107", "INP001", "N802"], "examples/*" = ["INP", "D", "N"]}
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

The ignore patterns for 'examples/' use incomplete rule codes. Ruff requires complete error codes (e.g., 'INP001', 'D100', 'N802') rather than prefixes. The patterns 'INP', 'D', and 'N' will not match any rules and should be replaced with specific error codes or wildcard patterns like 'INP', 'D*', 'N*'.

Suggested change
per-file-ignores = { "test/*" = ["D100", "D102", "D103", "D107", "INP001", "N802"], "examples/*" = ["INP", "D", "N"]}
per-file-ignores = { "test/*" = ["D100", "D102", "D103", "D107", "INP001", "N802"], "examples/*" = ["INP*", "D*", "N*"]}

Copilot uses AI. Check for mistakes.
Comment on lines +42 to +44
x_value: np.ndarray[tuple[int], np.dtype[float]],
y_value: np.ndarray[tuple[int], np.dtype[float]],
) -> float:
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

The return type annotation is 'float', but this function operates on numpy arrays and returns a numpy array (or array-like) via np.exp(-logp). The return type should be 'np.ndarray' or match the actual return type. Additionally, the input arrays should likely use 'np.floating' instead of 'float' to match the pattern used in the base class, or use simpler annotations like 'np.ndarray'.

Suggested change
x_value: np.ndarray[tuple[int], np.dtype[float]],
y_value: np.ndarray[tuple[int], np.dtype[float]],
) -> float:
x_value: np.ndarray,
y_value: np.ndarray,
) -> np.ndarray:

Copilot uses AI. Check for mistakes.
Comment on lines +51 to +53
x_value: np.ndarray[tuple[int], np.dtype[float]],
y_value: np.ndarray[tuple[int], np.dtype[float]],
density: np.ndarray[tuple[int], np.dtype[float]],
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

The type annotations use 'np.dtype[float]' but should use 'np.dtype[np.floating]' to match numpy's type system and be consistent with the base class API in src/ls_mcmc/model.py. Alternatively, use simpler type hints like 'np.ndarray' without generic parameters, which is more common and readable for example code.

Copilot uses AI. Check for mistakes.
@flxrcz flxrcz mentioned this pull request Nov 7, 2025
Closed
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants