Skip to content

Commit a651abc

Browse files
committed
rename import traces
1 parent 618f1be commit a651abc

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

_unittest/test_12_PostProcessing.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,6 @@ def test_09c_import_into_report(self):
326326
new_report = self.aedtapp.create_scattering("import_test")
327327
csv_file_path = self.aedtapp.post.export_report_to_csv(self.local_scratch.path, "import_test")
328328
rdat_file_path = self.aedtapp.post.export_report_to_file(self.local_scratch.path, "import_test", ".rdat")
329-
# self.aedtapp.post.export_report_to_jpg(self.local_scratch.path, "import_test")
330-
# jpg_file_path = os.path.join(self.local_scratch.path, "import_test.jpg")
331329
plot_name = new_report.plot_name
332330

333331
trace_names = []
@@ -340,25 +338,22 @@ def test_09c_import_into_report(self):
340338
my_data = self.aedtapp.post.get_report_data(expression=trace_names, families_dict=families)
341339
my_data.export_data_to_csv(os.path.join(self.local_scratch.path, "output.csv"))
342340
csv_solution_data_file_path = os.path.join(self.local_scratch.path, "output.csv")
343-
assert not new_report.import_into_report(csv_solution_data_file_path, plot_name)
341+
assert not new_report.import_traces(csv_solution_data_file_path, plot_name)
344342

345343
# test import with correct inputs from csv
346-
assert new_report.import_into_report(csv_file_path, plot_name)
344+
assert new_report.import_traces(csv_file_path, plot_name)
347345
# test import with correct inputs from rdat
348-
assert new_report.import_into_report(rdat_file_path, plot_name)
346+
assert new_report.import_traces(rdat_file_path, plot_name)
349347
# test import with not existing plot_name
350348
if not is_ironpython:
351349
with pytest.raises(ValueError):
352-
new_report.import_into_report(csv_file_path, "plot_name")
350+
new_report.import_traces(csv_file_path, "plot_name")
353351
# test import with random file path
354352
with pytest.raises(FileExistsError):
355-
new_report.import_into_report(str(uuid.uuid4()), plot_name)
353+
new_report.import_traces(str(uuid.uuid4()), plot_name)
356354
# test import without plot_name
357355
with pytest.raises(ValueError):
358-
new_report.import_into_report(csv_file_path, None)
359-
# test import with wrong file extension
360-
# with pytest.raises(ValueError):
361-
# new_report.import_into_report(jpg_file_path, plot_name)
356+
new_report.import_traces(csv_file_path, None)
362357

363358
def test_09d_delete_traces_from_report(self):
364359
new_report = self.aedtapp.create_scattering("delete_traces_test")

pyaedt/modules/report_templates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,7 @@ def edit_header(
12731273
return self._change_property("Header", "Header", props)
12741274

12751275
@pyaedt_function_handler
1276-
def import_into_report(self, file_path, plot_name):
1276+
def import_traces(self, file_path, plot_name):
12771277
"""Import report data from a file into a specified report.
12781278
12791279
Parameters

0 commit comments

Comments
 (0)