-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from matteobachetti/add_tests
Add tests
- Loading branch information
Showing
7 changed files
with
101 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Created: 2022-05-03T20:36:51.557233 | ||
# PINT_version: 0.8.5 | ||
# User: meo | ||
# Host: portabile3.home-life.hub | ||
# OS: macOS-10.16-x86_64-i386-64bit | ||
# Format: pint | ||
PSR Dummy | ||
EPHEM DE421 | ||
RAJ 9:55:51.04010000 | ||
DECJ 69:40:45.49010000 | ||
PMRA 0.0 | ||
PMDEC 0.0 | ||
F0 7.5 0.000000000001 | ||
F1 0.0 | ||
PEPOCH 56357 | ||
PLANET_SHAPIRO N | ||
BINARY ELL1 | ||
PB 2.532971 0.000001 | ||
PBDOT 0 | ||
A1 22.215 0.001 | ||
TASC 56682.0669000000000000 0.00000001 | ||
EPS1 0.0 | ||
EPS2 0.0 | ||
TZRMJD 56699.5093620635053249 | ||
TZRSITE ssb | ||
TZRFRQ inf | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Created: 2022-05-03T20:36:51.557233 | ||
# PINT_version: 0.8.5 | ||
# User: meo | ||
# Host: portabile3.home-life.hub | ||
# OS: macOS-10.16-x86_64-i386-64bit | ||
# Format: pint | ||
PSR Dummy | ||
EPHEM DE421 | ||
RAJ 9:55:51.04010000 | ||
DECJ 69:40:45.49010000 | ||
PMRA 0.0 | ||
PMDEC 0.0 | ||
F0 7.5 0.000000000001 | ||
F1 0.0 | ||
PEPOCH 56357 | ||
PLANET_SHAPIRO N | ||
BINARY ELL1 | ||
PB 2.532971 0.000001 | ||
PBDOT 0 | ||
A1 22.215 0.001 | ||
TASC 56682.0669000000000000 0.00000001 | ||
EPS1 0.0 | ||
EPS2 0.0 | ||
TZRMJD 56699.5093620635053249 | ||
TZRSITE ssb | ||
TZRFRQ inf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import os | ||
import glob | ||
from ell1fit.ell1fit import main as main_ell1fit | ||
from ell1fit.create_parfile import main as main_ell1par | ||
|
||
|
||
curdir = os.path.abspath(os.path.dirname(__file__)) | ||
datadir = os.path.join(curdir, "data") | ||
|
||
|
||
class TestExecution(): | ||
@classmethod | ||
def setup_class(cls): | ||
cls.event_files = sorted(glob.glob(os.path.join(datadir, "events[01].nc"))) | ||
cls.param_files = sorted(glob.glob(os.path.join(datadir, "events[01].par"))) | ||
|
||
def test_ell1fit_and_ell1par(self): | ||
cmdlines = self.event_files + ["-p"] + self.param_files + ["-P", "F0,PB,A1,TASC"] | ||
|
||
cmdline1 = cmdlines + ["--nsteps", "100"] | ||
cmdline2 = cmdlines + ["--nsteps", "200"] | ||
|
||
# Get to 100, then continue up to 200 | ||
main_ell1fit(cmdline1) | ||
main_ell1fit(cmdline2) | ||
|
||
outputs = sorted(glob.glob(os.path.join(datadir, "events[01]_A1_F0_PB_TASC_results.ecsv"))) | ||
for out in outputs: | ||
assert os.path.exists(out) | ||
|
||
main_ell1par(f"{outputs[0]} -p {self.param_files[0]}".split()) | ||
main_ell1par(f"{outputs[1]} -p {self.param_files[1]}".split()) | ||
|
||
out_param = sorted(glob.glob(os.path.join(datadir, "events[01]_A1_F0_PB_TASC_results.par"))) | ||
for out in out_param: | ||
assert os.path.exists(out) | ||
|
||
@classmethod | ||
def teardown_class(cls): | ||
outs = glob.glob(os.path.join(datadir, '*A1_*TASC*')) | ||
for out in outs: | ||
os.remove(out) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters