Skip to content

Remove unused __main__ block in tests #222

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 2 commits into from
Jun 27, 2025
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/rm_main.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* No news: edits to test files

**Fixed:**

* <news item>

**Security:**

* <news item>
4 changes: 0 additions & 4 deletions tests/test_morphapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,3 @@ def gaussian(x, mu, sigma):
)
assert pytest.approx(abs(pdf_smear_results["smear"])) == 4.0
assert pytest.approx(pdf_smear_results["Rw"]) == 0.0


if __name__ == "__main__":
TestApp()
8 changes: 0 additions & 8 deletions tests/test_morphchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,3 @@ def test_morph(self, setup):
pytest.approx(x_morph[1] - x_morph[0], mgrid.rstep)
assert numpy.allclose(y_morph, y_target)
return


# End of class TestMorphChain

if __name__ == "__main__":
TestMorphChain()

# End of file
8 changes: 0 additions & 8 deletions tests/test_morphpdftordf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,3 @@ def test_transform(self, setup):
assert numpy.allclose(rdf1, y_morph)
assert numpy.allclose(rdf2, y_target)
return


# End of class TestTransformXtalPDFtoRDF

if __name__ == "__main__":
TestTransformXtalPDFtoRDF()

# End of file
4 changes: 0 additions & 4 deletions tests/test_morphpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,3 @@ def linear(x, y, s):
for i in range(5):
assert pytest.approx(morph_info["squeeze"][f"a{i}"]) == i + 1
assert pytest.approx(morph_info["funcy"]["s"]) == 2.5


if __name__ == "__main__":
TestMorphpy()
8 changes: 0 additions & 8 deletions tests/test_morphrdftopdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,3 @@ def test_transform(self, setup):
assert numpy.allclose(rdf1, y_morph)
assert numpy.allclose(rdf2, y_target)
return


# End of class TestTransformXtalRDFtoPDF

if __name__ == "__main__":
TestTransformXtalRDFtoPDF()

# End of file
8 changes: 0 additions & 8 deletions tests/test_morphresolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,3 @@ def test_morph(self, setup):
assert numpy.allclose(self.y_target, y_target)
assert numpy.allclose(y_morph, y_target)
return


# End of class TestMorphScale

if __name__ == "__main__":
TestMorphScale()

# End of file
8 changes: 0 additions & 8 deletions tests/test_morphrgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,3 @@ def testRstepOut(self, setup):
pytest.approx(0.01, morph.rstep)
self._runTests(xyallout, morph)
return


# End of class TestMorphRGrid

if __name__ == "__main__":
TestMorphRGrid()

# End of file
8 changes: 0 additions & 8 deletions tests/test_morphscale.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,3 @@ def test_morph(self, setup):
assert numpy.allclose(2 * self.y_morph, y_morph)
assert numpy.allclose(self.y_target, y_target)
return


# End of class TestMorphScale

if __name__ == "__main__":
TestMorphScale()

# End of file
9 changes: 0 additions & 9 deletions tests/test_morphshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,3 @@ def ishape_test_helper(self, config):
else: # Outside the particle morph should be zero
assert y_morph[idx] == 0
return


# End of class TestMorphSpheroid

if __name__ == "__main__":
TestMorphSphere()
TestMorphSpheroid()

# End of file
8 changes: 0 additions & 8 deletions tests/test_morphshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,3 @@ def test_morph(self, setup):
assert numpy.allclose(self.x_target, x_target)
assert numpy.allclose(self.y_target, y_target)
return


# End of class TestMorphScale

if __name__ == "__main__":
TestMorphShift()

# End of file
8 changes: 0 additions & 8 deletions tests/test_morphsmear.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,3 @@ def test_morph(self, setup):

assert numpy.allclose(ysmear, y_morph)
return


# End of class TestMorphSmear

if __name__ == "__main__":
TestMorphSmear()

# End of file
9 changes: 0 additions & 9 deletions tests/test_morphstretch.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,9 @@ def test_morph(self, setup):
return


# End of class TestMorphSmear


def heaviside(x, lb, ub):
"""The Heaviside function."""
y = numpy.ones_like(x)
y[x < lb] = 0.0
y[x > ub] = 0.0
return y


if __name__ == "__main__":
TestMorphStretch()

# End of file
7 changes: 0 additions & 7 deletions tests/test_refine.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,3 @@ def test_refine(self, setup):
rw = (numpy.dot(diff, diff) / numpy.dot(yrsel, yrsel)) ** 0.5
assert rw < 0.01
return


if __name__ == "__main__":
TestRefine()
TestRefineUC()

# End of file
8 changes: 0 additions & 8 deletions tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,3 @@ def test_get_values_from_dictionary_collection(self):
)
== target_list
)


# End of class TestTools

if __name__ == "__main__":
TestTools()

# End of file
Loading