Skip to content

fix: make fitting test self-contained#201

Merged
sbillinge merged 7 commits into
diffpy:mainfrom
john-halloran:forge-cleanup
Jun 23, 2026
Merged

fix: make fitting test self-contained#201
sbillinge merged 7 commits into
diffpy:mainfrom
john-halloran:forge-cleanup

Conversation

@john-halloran

@john-halloran john-halloran commented May 1, 2026

Copy link
Copy Markdown
Contributor

@sbillinge This PR was made with your comments here in mind. All test data is now self-contained. If we want to run on the real data, that can be something we do as part of the release process, but we no longer need to distribute large data files with the sdist.

@codecov

codecov Bot commented May 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.28%. Comparing base (d7586bc) to head (92c0ddb).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #201      +/-   ##
==========================================
- Coverage   77.50%   74.28%   -3.22%     
==========================================
  Files           3        3              
  Lines          40       35       -5     
==========================================
- Hits           31       26       -5     
  Misses          9        9              
Files with missing lines Coverage Δ
tests/test_snmf_optimizer.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sbillinge sbillinge left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@john-halloran please see my comment below.

Comment thread .pre-commit-config.yaml Outdated
@@ -1,5 +1,5 @@
default_language_version:
python: python3
python: python3.13

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we make this change we need to make an issue to change it back. The fix I think though is to include the change from docformatter to ruff. Please look at the scikit-package code to see the changes that are needed. There is an update to this yaml file and then also to the pyproject.toml. Then the pre-commit will work on 3.14.

@sbillinge sbillinge left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please see my comment

Comment thread .pre-commit-config.yaml Outdated
@@ -1,5 +1,5 @@
default_language_version:
python: python3
python: python3.13

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please remove this. We don't want this, but update all the pre-commit versions, e.g. the below is copied from diffpy.utils:

default_language_version:
  python: python3
ci:
  autofix_commit_msg: |
    [pre-commit.ci] auto fixes from pre-commit hooks
  autofix_prs: true
  autoupdate_branch: "pre-commit-autoupdate"
  autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
  autoupdate_schedule: monthly
  skip: [no-commit-to-branch]
  submodules: false
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v6.0.0
    hooks:
      - id: check-yaml
      - id: end-of-file-fixer
      - id: trailing-whitespace
      - id: check-case-conflict
      - id: check-merge-conflict
      - id: check-toml
      - id: check-added-large-files
  - repo: https://github.com/psf/black
    rev: 26.5.1
    hooks:
      - id: black
  - repo: https://github.com/pycqa/flake8
    rev: 7.3.0
    hooks:
      - id: flake8
  - repo: https://github.com/pycqa/isort
    rev: 9.0.0a3
    hooks:
      - id: isort
        args: ["--profile", "black"]
  - repo: https://github.com/kynan/nbstripout
    rev: 0.9.1
    hooks:
      - id: nbstripout
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v6.0.0
    hooks:
      - id: no-commit-to-branch
        name: Prevent Commit to Main Branch
        args: ["--branch", "main"]
        stages: [pre-commit]
  - repo: https://github.com/codespell-project/codespell
    rev: v2.4.2
    hooks:
      - id: codespell
        additional_dependencies:
          - tomli
  # prettier - multi formatter for .json, .yml, and .md files
  - repo: https://github.com/pre-commit/mirrors-prettier
    rev: v4.0.0-alpha.8
    hooks:
      - id: prettier
        additional_dependencies:
          - "prettier@^3.2.4"
  # docformatter - PEP 257 compliant docstring formatter
  - repo: https://github.com/PyCQA/docformatter
    rev: v1.7.8
    hooks:
      - id: docformatter
        additional_dependencies: [tomli]
        args: [--in-place, --config, ./pyproject.toml]

and the relevant block in pyproject.toml is

[tool.docformatter]
recursive = true
wrap-summaries = 72
wrap-descriptions = 72

please adapt as needed here.

@sbillinge sbillinge merged commit 39bc1ac into diffpy:main Jun 23, 2026
7 checks passed
@john-halloran john-halloran deleted the forge-cleanup branch June 23, 2026 18:10
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