Commit e6b6d417 authored by Niels-Oliver Walkowski's avatar Niels-Oliver Walkowski
Browse files

refac(mod): Adapt contant names to PEP8

parent bd495ef3
......@@ -3,7 +3,7 @@ from cv2 import imread, imwrite
import numpy as np
from .movie import Movie
SUMMARY = {'seqmean': {'monochromatic': ['luminance'],
_summary = {'seqmean': {'monochromatic': ['luminance'],
'saturation': ['saturation', 'colourfulness'],
'hue': ['hsV', 'labHcl']},
'distribution': {'monochromatic': ['luminance'],
......@@ -20,7 +20,7 @@ class Corpus(object):
def __init__(self, path='./', summary=False):
self.basedir = Path(path)
self.summary = summary if summary else SUMMARY
self.summary = summary if summary else _summary
self.status = self._report() # Aktualisieren nach jeder Digitalisier.
self.movies = self._instantiate_movies()
......@@ -106,17 +106,17 @@ class Corpus(object):
tasks = {}
for m in self.status.keys():
for view in SUMMARY.keys():
for view in _summary.keys():
if view not in self.status[m]['data'].keys():
tasks[view] = SUMMARY[view]
tasks[view] = _summary[view]
for contrast in SUMMARY[view].keys():
for contrast in _summary[view].keys():
if contrast not in self.status[m]['data'][view].keys():
tasks.setdefault(view, {})[contrast] = (SUMMARY[view][contrast])
tasks.setdefault(view, {})[contrast] = (_summary[view][contrast])
for method in SUMMARY[view][contrast]:
for method in _summary[view][contrast]:
if method not in self.status[m]['data'][view][contrast].keys():
tasks.setdefault(view, {}).setdefault(contrast, []).append(method)
......@@ -151,12 +151,19 @@ class Corpus(object):
numpy.ndarray -- A numpy ndarry with the data type uint8
showing the tableau as an image.
FEATURE Allow to create tableaus for all diagrams available for a
specific movie
FIXME Move tableau methods to the visuals module
components = self._filter_diagrams(shape=shape, ctrst=ctrst, meth=meth)
layout = self.layout_tableau(len(components))
tableau = self._fit_components(components, layout)
if write:
imwrite('tableau.png', tableau)
file_name = self.basedir / (shape + '_' + ctrst + '_' +
meth + '.png')
imwrite(str(file_name), tableau)
return tableau
def _filter_diagrams(self,
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment