Skip to content

Commit ab20116

Browse files
authored
Merge pull request #31 from FireDynamics/development_sven
adds an acceptance test suit can be started via python -m ledsa -atest and much refactoring done
2 parents 7c0b5c2 + bd10fb3 commit ab20116

21 files changed

+792
-518
lines changed

ledsa/__main__.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# this file is executed if the package is run via python -m ledsa [arguments]
22

33
import argparse
4+
import sys
5+
46
from .ledsa import LEDSA
57
from .core import ledsa_conf as lc
68

@@ -21,14 +23,15 @@
2123
parser.add_argument('--coordinates', '-coord', action='store_true',
2224
help='Calculates the 3D coordinates from the coordinates given in the configfile and the '
2325
'reference image.')
26+
parser.add_argument('--atest', '-atest', action='store_true',
27+
help='Runs the acceptance test suit')
2428
args = parser.parse_args()
2529

2630
print('ledsa runs with the following arguments:')
2731
print(args)
2832

29-
if args.config is None and not args.s1 and not args.s2 and not args.s3 and not args.re and not args.coordinates:
30-
args.config = []
31-
args.s1 = args.s2 = args.s3 = True
33+
if len(sys.argv) == 1:
34+
print('Please give an argument. Get help with --h')
3235

3336
if args.config is not None:
3437
if len(args.config) == 0:
@@ -63,3 +66,7 @@
6366
if args.coordinates:
6467
from ledsa.ledpositions.coordinates import calculate_coordinates
6568
calculate_coordinates()
69+
70+
if args.atest:
71+
# noinspection PyUnresolvedReferences
72+
import ledsa.tests.AcceptanceTests.__main__

ledsa/analysis/calculations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from ..core.ledsa_conf import ConfigData
22
import numpy as np
33
import pandas as pd
4-
from ..core import _led_helper as led
4+
from ..core import led_helper as led
55
import os
66

77
# os path separator

ledsa/analysis/plot_functions.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import ledsa.core.model
12
import matplotlib.pyplot as plt
23
import numpy as np
34
import pandas as pd
45
from PIL import Image
56

67
from ledsa import LEDSA
7-
from ..core import _led_helper as led
8+
from ..core import led_helper as led
89
import ledsa.analysis.calculations as calc
910
from ..core.ledsa_conf import ConfigData as CD
1011
import os
@@ -146,8 +147,8 @@ def plot_model(fig, channel, img_id, led_id, window_radius):
146147
# load model
147148
model_params = load_model(img_id, led_id, channel, window_radius)
148149

149-
led_model = led.led_fit(mesh[0], mesh[1], model_params[0], model_params[1], model_params[2], model_params[3],
150-
model_params[4], model_params[5], model_params[6], model_params[7])
150+
led_model = ledsa.core.model.led_fit(mesh[0], mesh[1], model_params[0], model_params[1], model_params[2], model_params[3],
151+
model_params[4], model_params[5], model_params[6], model_params[7])
151152

152153
current_fig = plt.gcf()
153154

ledsa/analysis/ui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import ledsa.analysis.plot_functions as pf
22
import matplotlib.pyplot as plt
33
import matplotlib
4-
import ledsa.core._led_helper as led
4+
import ledsa.core.led_helper as led
55
import tkinter as tk
66
import subprocess
77
import os

0 commit comments

Comments
 (0)