Skip to content

Commit

Permalink
Merge pull request #31 from VirtualPlanetaryLaboratory/FolderExists
Browse files Browse the repository at this point in the history
Folder exists
  • Loading branch information
RoryBarnes authored Sep 26, 2023
2 parents d13a6fe + 9a72101 commit 4390312
Show file tree
Hide file tree
Showing 71 changed files with 79 additions and 1,476 deletions.
2 changes: 1 addition & 1 deletion bigplanet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
__author__ = "Caitlyn Wilhelm (cwilhelm@uw.edu)"
__copyright__ = "Copyright 2020 Caitlyn Wilhelm"

from .bp_extract import *
from .extract import *
from .bigplanet import *
6 changes: 3 additions & 3 deletions bigplanet/bigplanet_archive.py → bigplanet/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import numpy as np
import pandas as pd

from .bp_extract import *
from .bp_get import *
from .bp_process import *
from .extract import *
from .read import *
from .process import *


def Archive(bpInputFile, cores, quiet, force, ignorecorrupt, verbose):
Expand Down
8 changes: 4 additions & 4 deletions bigplanet/bigplanet.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import numpy as np
import pandas as pd

from .bigplanet_archive import Archive
from .bigplanet_filter import Filter
from .bp_extract import Md5CheckSum
from .bp_get import ReadFile
from .archive import Archive
from .filter import Filter
from .extract import Md5CheckSum
from .read import ReadFile


def Main(
Expand Down
4 changes: 2 additions & 2 deletions bigplanet/bp_extract.py → bigplanet/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import pandas as pd
from scipy import stats

from .bp_get import GetVplanetHelp
from .bp_process import DictToBP
from .read import GetVplanetHelp
from .process import DictToBP


def BPLFile(hf, ignore_corrupt=False):
Expand Down
6 changes: 3 additions & 3 deletions bigplanet/bigplanet_filter.py → bigplanet/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import numpy as np
import pandas as pd

from .bp_extract import *
from .bp_get import *
from .bp_process import *
from .extract import *
from .read import *
from .process import *


def SplitsaKey(saKeylist, verbose):
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/CreateHDF5/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
__author__ = "Caitlyn Wilhelm (cwilhelm@uw.edu)"
__copyright__ = "Copyright 2020 Caitlyn Wilhelm"

from bigplanet.bp_extract import *
from bigplanet.extract import *
from bigplanet import *
5 changes: 5 additions & 0 deletions tests/CreateHDF5/test_CreateHDF5.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ def test_CreateHDF5():
# checks if the bpl files exist
assert os.path.isfile(file) == True

shutil.rmtree(path / "BP_CreateHDF5")
os.remove(path / ".BP_CreateHDF5")
os.remove(path / ".BP_CreateHDF5_BPL")
os.remove(path / "BP_CreateHDF5.bpa")
os.remove(path / "BP_CreateHDF5.md5")

if __name__ == "__main__":
test_CreateHDF5()
2 changes: 1 addition & 1 deletion tests/ExtractArchive/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
__author__ = "Caitlyn Wilhelm (cwilhelm@uw.edu)"
__copyright__ = "Copyright 2020 Caitlyn Wilhelm"

from bigplanet.bp_extract import *
from bigplanet.extract import *
from bigplanet import *
12 changes: 6 additions & 6 deletions tests/ExtractArchive/test_ExtractArchive.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ def test_ExtractArchive():
os.remove(path / ".BP_Extract_BPL")
if (path / "BP_Extract.bpa").exists():
os.remove(path / "BP_Extract.bpa")
if (path / "../BP_Extract.md5").exists():
os.remove(path / "../BP_Extract.md5")
if (path / "BP_Extract.md5").exists():
os.remove(path / "BP_Extract.md5")

Expand All @@ -46,9 +44,7 @@ def test_ExtractArchive():
# Run bigplanet
print("Running BigPlanet.")
sys.stdout.flush()

######## SOMETHING IS WRONG WITH MD5CHECKSUMS! #######
subprocess.check_output(["bigplanet", "-ignorecorrupt", "bpl.in", "-a"], cwd=path)
subprocess.check_output(["bigplanet", "bpl.in", "-a"], cwd=path)

file = bp.BPLFile(path / "BP_Extract.bpa")

Expand All @@ -59,9 +55,13 @@ def test_ExtractArchive():

assert np.isclose(earth_Instellation_final[0], 1367.635318)
assert np.isclose(earth_Instellation_final[1], 341.90883)

assert np.isclose(sun_RotPer_initial[0], 86400.0)

shutil.rmtree(path / "BP_Extract")
os.remove(path / ".BP_Extract")
os.remove(path / ".BP_Extract_BPL")
os.remove(path / "BP_Extract.bpa")
os.remove(path / "BP_Extract.md5")

if __name__ == "__main__":
test_ExtractArchive()
2 changes: 1 addition & 1 deletion tests/ExtractFilterArchive/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
__author__ = "Caitlyn Wilhelm (cwilhelm@uw.edu)"
__copyright__ = "Copyright 2020 Caitlyn Wilhelm"

from bigplanet.bp_extract import *
from bigplanet.extract import *
from bigplanet import *
8 changes: 6 additions & 2 deletions tests/ExtractFilterArchive/test_ExtractFilterArchive.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ def test_ExtractFilterArchive():
os.remove(path / "BP_Extract.bpa")
if (path / "Test.bpf").exists():
os.remove(path / "Test.bpf")
if (path / "../BP_Extract.md5").exists():
os.remove(path / "../BP_Extract.md5")
if (path / "BP_Extract.md5").exists():
os.remove(path / "BP_Extract.md5")

Expand Down Expand Up @@ -73,6 +71,12 @@ def test_ExtractFilterArchive():
assert np.isclose(vpl_stoptime_option[0], 4.5e9)
assert np.isclose(earth_tman_forward[0][0], 3000.0)

shutil.rmtree(path / "BP_Extract")
os.remove(path / ".BP_Extract")
os.remove(path / ".BP_Extract_BPL")
os.remove(path / "BP_Extract.bpa")
os.remove(path / "Test.bpf")
os.remove(path / "BP_Extract.md5")

if __name__ == "__main__":
test_ExtractFilterArchive()
5 changes: 0 additions & 5 deletions tests/ExtractFilterRaw/.BP_Extract

This file was deleted.

55 changes: 0 additions & 55 deletions tests/ExtractFilterRaw/BP_Extract/semi_a0/earth.in

This file was deleted.

9 changes: 0 additions & 9 deletions tests/ExtractFilterRaw/BP_Extract/semi_a0/sun.in

This file was deleted.

44 changes: 0 additions & 44 deletions tests/ExtractFilterRaw/BP_Extract/semi_a0/vpl.in

This file was deleted.

33 changes: 0 additions & 33 deletions tests/ExtractFilterRaw/BP_Extract/semi_a0/vplanet_log

This file was deleted.

55 changes: 0 additions & 55 deletions tests/ExtractFilterRaw/BP_Extract/semi_a1/earth.in

This file was deleted.

9 changes: 0 additions & 9 deletions tests/ExtractFilterRaw/BP_Extract/semi_a1/sun.in

This file was deleted.

Loading

0 comments on commit 4390312

Please sign in to comment.