8000 Changes is_mock to convert arg by domna · Pull Request #107 · FAIRmat-NFDI/pynxtools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Changes is_mock to convert arg #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2023
Merged
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
8 changes: 4 additions & 4 deletions pynxtools/dataconverter/readers/ellips/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class EllipsometryReader(BaseReader):
supported_nxdls = ["NXellipsometry"]

@staticmethod
def populate_header_dict_with_datasets(file_paths):
def populate_header_dict_with_datasets(file_paths, is_mock=False):
"""This is an ellipsometry-specific processing of data.

The procedure is the following:
Expand Down Expand Up @@ -269,7 +269,6 @@ def populate_header_dict_with_datasets(file_paths):
header["angle_of_incidence"] = unique_angles

# Create mocked ellipsometry data template:
is_mock = True
if is_mock:
header, labels = mock_function(header)
for angle in enumerate(header["angle_of_incidence"]):
Expand All @@ -289,7 +288,8 @@ def populate_header_dict_with_datasets(file_paths):
def read(self,
template: dict = None,
file_paths: Tuple[str] = None,
objects: Tuple[Any] = None) -> dict:
objects: Tuple[Any] = None,
is_mock: bool = False) -> dict:
""" Reads data from given file and returns a filled template dictionary.

A handlings of virtual datasets is implemented:
Expand All @@ -306,7 +306,7 @@ def read(self,

# The header dictionary is filled with entries.
header, labels = (
EllipsometryReader.populate_header_dict_with_datasets(file_paths)
EllipsometryReader.populate_header_dict_with_datasets(file_paths, is_mock)
)

data_list = []
Expand Down
0