Skip to content

Commit

Permalink
cleanup of test scripts: ClusterGrowth test adapted
Browse files Browse the repository at this point in the history
  • Loading branch information
hechtprojects committed May 22, 2024
1 parent c963938 commit 1a54f37
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 28 deletions.
2 changes: 0 additions & 2 deletions test/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
# =============================================================================
import numpy as np
import unittest
import sys
sys.path.append('/Lukas/Documents/17_Promotion/10_scripts/development/amep-dev')
import os
import amep

Expand Down
4 changes: 4 additions & 0 deletions test/test_continuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,7 @@ def test_cluster(self):
)
plot.field(axe[2], labels, *trajectory[-1].grid)
fig.savefig(PLOT_DIR/"Cluster_test.pdf")


if __name__ == '__main__':
unittest.main()
4 changes: 2 additions & 2 deletions test/test_evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ def setUpClass(cls):

def test_cluster_growth(self):
self.assertTrue((ClusterGrowth(self.field_trajs[1], scale=1.5, cutoff=0.8,
ftype="c", mode="mean").frames <=
ftype="c", mode="mean").frames.sum() <=
ClusterGrowth(self.field_trajs[1], scale=1.5, cutoff=0.8,
ftype="c",
mode="weighted mean").frames).all())
mode="weighted mean").frames.sum()))
self.assertTrue((ClusterGrowth(self.field_trajs[1],
ftype="c",
mode="largest").frames >= 0).all())
Expand Down
5 changes: 4 additions & 1 deletion test/test_functions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# =============================================================================
# Copyright (C) 2023 Lukas Hecht and the AMEP development team.
# Copyright (C) 2023-2024 Lukas Hecht and the AMEP development team.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -50,3 +50,6 @@ def test_gaussian(self):
new_x = x_vec*0.3 + 2
axs.plot(new_x, gauss.generate(new_x), label="fit")
fig.savefig(PLOT_DIR/Path("test_gaussian.pdf"))

if __name__ == '__main__':
unittest.main()
2 changes: 0 additions & 2 deletions test/test_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@
# IMPORT MODULES
# =============================================================================
import unittest
import sys
from zipfile import ZipFile
from requests import get
from pathlib import Path
sys.path.append('/Lukas/Documents/17_Promotion/10_scripts/development/amep-dev')
import amep

SERVER_URL: str = "https://kuno.fkp.physik.tu-darmstadt.de/d/a3d9887b8a5747e0a56e/files/?p=/"
Expand Down
4 changes: 1 addition & 3 deletions test/test_order.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# =============================================================================
# Copyright (C) 2023 Lukas Hecht and the AMEP development team.
# Copyright (C) 2023-2024 Lukas Hecht and the AMEP development team.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -25,8 +25,6 @@
# =============================================================================
import numpy as np
import unittest
import sys
sys.path.append('/Lukas/Documents/17_Promotion/10_scripts/development/amep-dev')
import amep

# =============================================================================
Expand Down
5 changes: 4 additions & 1 deletion test/test_particle_methods.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# =============================================================================
# Copyright (C) 2023 Lukas Hecht and the AMEP development team.
# Copyright (C) 2023-2024 Lukas Hecht and the AMEP development team.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -129,3 +129,6 @@ def test_frame_methods(self):
first_frame.ids(ptype=ptypes)
first_frame.data("x", "vx",
"omegay", "id", ptype=ptypes)

if __name__ == '__main__':
unittest.main()
4 changes: 1 addition & 3 deletions test/test_pbc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# =============================================================================
# Copyright (C) 2023 Lukas Hecht and the AMEP development team.
# Copyright (C) 2023-2024 Lukas Hecht and the AMEP development team.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -25,8 +25,6 @@
# =============================================================================
import numpy as np
import unittest
import sys
sys.path.append('/Lukas/Documents/17_Promotion/10_scripts/development/amep-dev')
import amep

# =============================================================================
Expand Down
4 changes: 1 addition & 3 deletions test/test_plot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# =============================================================================
# Copyright (C) 2023 Lukas Hecht and the AMEP development team.
# Copyright (C) 2023-2024 Lukas Hecht and the AMEP development team.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -19,8 +19,6 @@
# =============================================================================
"""Test units for all functions in the plot part of amep"""
import unittest
import sys
sys.path.append('/Lukas/Documents/17_Promotion/10_scripts/development/amep-dev')
from requests import get
from pathlib import Path
from zipfile import ZipFile
Expand Down
2 changes: 0 additions & 2 deletions test/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
# =============================================================================
import numpy as np
import unittest
import sys
sys.path.append('/Lukas/Documents/17_Promotion/10_scripts/development/amep-dev')
import amep
import os

Expand Down
4 changes: 1 addition & 3 deletions test/test_spatialcor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# =============================================================================
# Copyright (C) 2023 Lukas Hecht and the AMEP development team.
# Copyright (C) 2023-2024 Lukas Hecht and the AMEP development team.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -25,8 +25,6 @@
# =============================================================================
import numpy as np
import unittest
import sys
sys.path.append('/Lukas/Documents/17_Promotion/10_scripts/development/amep-dev')
import amep


Expand Down
4 changes: 1 addition & 3 deletions test/test_timecor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# =============================================================================
# Copyright (C) 2023 Lukas Hecht and the AMEP development team.
# Copyright (C) 2023-2024 Lukas Hecht and the AMEP development team.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -25,8 +25,6 @@
# =============================================================================
import numpy as np
import unittest
import sys
sys.path.append('/Lukas/Documents/17_Promotion/10_scripts/development/amep-dev')
import amep


Expand Down
4 changes: 1 addition & 3 deletions test/test_trajectory.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# =============================================================================
# Copyright (C) 2023 Lukas Hecht and the AMEP development team.
# Copyright (C) 2023-2024 Lukas Hecht and the AMEP development team.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -25,8 +25,6 @@
# =============================================================================
import numpy as np
import unittest
import sys
sys.path.append('/Lukas/Documents/17_Promotion/10_scripts/development/amep-dev')
import amep
import os

Expand Down

0 comments on commit 1a54f37

Please sign in to comment.