Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions news/single-line-comment.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* Support single line comment in the macro file.

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
3 changes: 3 additions & 0 deletions src/diffpy/apps/app_runmacro.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
RawValue:
/[^\s]+/
;


Comment: /#[^\n]*/;
"""


Expand Down
3 changes: 1 addition & 2 deletions src/diffpy/apps/pdfadapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
from pathlib import Path

import numpy
from scipy.optimize import least_squares

from diffpy.srfit.fitbase import (
FitContribution,
FitRecipe,
Expand All @@ -14,6 +12,7 @@
from diffpy.srfit.pdf import PDFGenerator, PDFParser
from diffpy.srfit.structure import constrainAsSpaceGroup
from diffpy.structure.parsers import getParser
from scipy.optimize import least_squares


class PDFAdapter:
Expand Down
1 change: 0 additions & 1 deletion tests/helper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import numpy as np

from diffpy.srfit.fitbase import FitContribution, FitRecipe, Profile
from diffpy.srfit.pdf import PDFGenerator, PDFParser
from diffpy.srfit.structure import constrainAsSpaceGroup
Expand Down
12 changes: 12 additions & 0 deletions tests/test_runmacro.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,18 @@ def test_meta_model():
},
{},
),
# C10: comments. Expect no error is raised by textx
(
f"""
# This is a comment
load structure G1 from "{_STRUCTURE_PATH}"
""",
{
"initialize_structures.structure_paths": _STRUCTURE_PATH,
"initialize_structures.names": ["G1"],
},
{"G1": "structure"},
),
],
)
def test_command_processor(
Expand Down
Loading