Skip to content

Commit

Permalink
cleaning project info
Browse files Browse the repository at this point in the history
  • Loading branch information
andped10 committed Nov 18, 2024
1 parent 837089b commit 9c2f3b6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 27 deletions.
4 changes: 1 addition & 3 deletions src/easyreflectometry/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,8 @@ def remove_material(self, index: int) -> None:

def _default_info(self):
return dict(
name='ExampleProject',
name='DefaultEasyReflectometryProject',
short_description='Reflectometry, 1D',
samples='None',
experiments='None',
modified=datetime.datetime.now().strftime('%d.%m.%Y %H:%M'),
)

Expand Down
8 changes: 0 additions & 8 deletions src/easyreflectometry/summary/html_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,6 @@
<th>Experiment datablock</th>
<th>experiment_name</th>
</tr>
<tr>
<td>Radiation probe</td>
<td>radiation_probe</td>
</tr>
<tr>
<td>Radiation type</td>
<td>radiation_type</td>
</tr>
<tr>
<td>Measured range: min, max</td>
<td>range_min,&nbsp;&nbsp;range_max,&nbsp;&nbsp</td>
Expand Down
2 changes: 1 addition & 1 deletion tests/summary/test_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_project_information_section(self, project: Project) -> None:
html = summary._project_information_section()

# Expect
assert 'ExampleProject' in html
assert 'DefaultEasyReflectometryProject' in html
assert 'Reflectometry, 1D' in html

def test_sample_section(self, project: Project) -> None:
Expand Down
20 changes: 5 additions & 15 deletions tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ def test_constructor(self):

# Expect
assert project._info == {
'name': 'ExampleProject',
'name': 'DefaultEasyReflectometryProject',
'short_description': 'Reflectometry, 1D',
'samples': 'None',
'experiments': 'None',
'modified': datetime.datetime.now().strftime('%d.%m.%Y %H:%M'),
}
assert project._path_project_parent == Path(os.path.expanduser('~'))
Expand Down Expand Up @@ -80,10 +78,8 @@ def test_reset(self):

# Expect
assert project._info == {
'name': 'ExampleProject',
'name': 'DefaultEasyReflectometryProject',
'short_description': 'Reflectometry, 1D',
'samples': 'None',
'experiments': 'None',
'modified': datetime.datetime.now().strftime('%d.%m.%Y %H:%M'),
}
assert project._models.unique_name == 'project_models'
Expand Down Expand Up @@ -269,7 +265,7 @@ def test_path_json(self, tmp_path):
project.set_path_project_parent(tmp_path)

# Then Expect
assert project.path_json == Path(tmp_path) / 'ExampleProject' / 'project.json'
assert project.path_json == Path(tmp_path) / 'DefaultEasyReflectometryProject' / 'project.json'

def test_add_material(self):
# When
Expand Down Expand Up @@ -317,10 +313,8 @@ def test_default_info(self):

# Expect
assert info == {
'name': 'ExampleProject',
'name': 'DefaultEasyReflectometryProject',
'short_description': 'Reflectometry, 1D',
'samples': 'None',
'experiments': 'None',
'modified': datetime.datetime.now().strftime('%d.%m.%Y %H:%M'),
}

Expand All @@ -341,10 +335,8 @@ def test_as_dict(self):
'with_experiments',
]
assert project_dict['info'] == {
'name': 'ExampleProject',
'name': 'DefaultEasyReflectometryProject',
'short_description': 'Reflectometry, 1D',
'samples': 'None',
'experiments': 'None',
'modified': datetime.datetime.now().strftime('%d.%m.%Y %H:%M'),
}
assert project_dict['calculator'] == 'refnx'
Expand Down Expand Up @@ -551,8 +543,6 @@ def test_create(self, tmp_path):
assert project._info == {
'name': 'TestProject',
'short_description': 'Reflectometry, 1D',
'samples': 'None',
'experiments': 'None',
'modified': datetime.datetime.now().strftime('%d.%m.%Y %H:%M'),
}

Expand Down

0 comments on commit 9c2f3b6

Please sign in to comment.