Skip to content

feat: add diffpy.app runmacro <.dp-in file> entry point#7

Merged
sbillinge merged 2 commits intodiffpy:mainfrom
ycexiao:entry-point
Apr 8, 2026
Merged

feat: add diffpy.app runmacro <.dp-in file> entry point#7
sbillinge merged 2 commits intodiffpy:mainfrom
ycexiao:entry-point

Conversation

@ycexiao
Copy link
Copy Markdown
Contributor

@ycexiao ycexiao commented Apr 8, 2026

What problem does this PR address?

Closes #6

Add an entry point and refactor the existing code.

diffpy.app runmacro <.dp-in>

What should the reviewer(s) do?

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.46%. Comparing base (aad7c3d) to head (c0de591).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main       #7   +/-   ##
=======================================
  Coverage   92.46%   92.46%           
=======================================
  Files           4        4           
  Lines         146      146           
=======================================
  Hits          135      135           
  Misses         11       11           
Files with missing lines Coverage Δ
tests/test_pdfadapter.py 100.00% <100.00%> (ø)
tests/test_runmacro.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ycexiao ycexiao marked this pull request as ready for review April 8, 2026 03:57
Copy link
Copy Markdown
Contributor Author

@ycexiao ycexiao left a comment

Choose a reason for hiding this comment

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

@sbillinge, it's ready for review.

----------
equation_string : str, optional
Equation passed to FitContribution.setEquation.
equation : list of str, optional
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

All arguments are passed as list.

@sbillinge sbillinge merged commit feb7259 into diffpy:main Apr 8, 2026
6 checks passed
@sbillinge
Copy link
Copy Markdown
Contributor

I merged this but I am a bit worried that we are not testing enough. It looked as if we were jut testing that the right variable values were parsed, but not testing anything about fucntionality or resulting code. Is that right?

@ycexiao
Copy link
Copy Markdown
Contributor Author

ycexiao commented Apr 8, 2026

Yes.

There are three layers: (1) the pdfadapter that wraps the diffpy.srfit (2) the textx that creates the parser grammar (3) the Parser that defines actions to take when specific command is read from the macro.

I think we don't need to worry too much about the first two layers, but the third layer needs more tests.

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.

chore: entry point for running .dp-in file

2 participants