-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pysiral] bugfix in config files and tests to identify them
- Loading branch information
Showing
10 changed files
with
182 additions
and
23 deletions.
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
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
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
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
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
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,35 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Testing all Level-2 output definition files for compabilility with | ||
Level2Processor conventions | ||
#TODO: Add CF/ACDD compliance checks | ||
@author: Stefan Hendricks | ||
""" | ||
|
||
import unittest | ||
from attrdict import AttrDict | ||
|
||
from pysiral import psrlcfg | ||
from pysiral.config import get_yaml_config | ||
from loguru import logger | ||
logger.disable("pysiral") | ||
|
||
|
||
class TestL1ProcDef(unittest.TestCase): | ||
|
||
def setUp(self): | ||
|
||
# Get a list of processor definition files in the code repository | ||
self.l1_proc_files = psrlcfg.get_settings_files("output", "l1") | ||
|
||
def testYamlSyntaxOfDefinitionFiles(self): | ||
for filename in self.l1_proc_files: | ||
content = get_yaml_config(filename) | ||
self.assertIsInstance(content, AttrDict, msg=filename) | ||
|
||
|
||
if __name__ == '__main__': | ||
suite = unittest.TestLoader().loadTestsFromTestCase(TestL1ProcDef) | ||
unittest.TextTestRunner(verbosity=2).run(suite) |
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,37 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Testing all Level-2 output definition files for compabilility with | ||
Level2Processor conventions | ||
#TODO: Add CF/ACDD compliance checks | ||
@author: Stefan Hendricks | ||
""" | ||
|
||
import unittest | ||
from attrdict import AttrDict | ||
|
||
from pysiral import psrlcfg | ||
from pysiral.config import get_yaml_config | ||
from loguru import logger | ||
logger.disable("pysiral") | ||
|
||
|
||
class TestL2OutputDef(unittest.TestCase): | ||
|
||
def setUp(self): | ||
|
||
# Get a list of processor definition files in the code repository | ||
l2i_files = psrlcfg.get_settings_files("output", "l2i") | ||
l2p_files = psrlcfg.get_settings_files("output", "l2p") | ||
self.l2_output_files = l2i_files + l2p_files | ||
|
||
def testYamlSyntaxOfDefinitionFiles(self): | ||
for filename in self.l2_output_files: | ||
content = get_yaml_config(filename) | ||
self.assertIsInstance(content, AttrDict, msg=filename) | ||
|
||
|
||
if __name__ == '__main__': | ||
suite = unittest.TestLoader().loadTestsFromTestCase(TestL2OutputDef) | ||
unittest.TextTestRunner(verbosity=2).run(suite) |
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
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,35 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Testing all Level-3 output definition files for compabilility with | ||
Level2Processor conventions | ||
#TODO: Add CF/ACDD compliance checks | ||
@author: Stefan Hendricks | ||
""" | ||
|
||
import unittest | ||
from attrdict import AttrDict | ||
|
||
from pysiral import psrlcfg | ||
from pysiral.config import get_yaml_config | ||
from loguru import logger | ||
logger.disable("pysiral") | ||
|
||
|
||
class TestL3OutputDef(unittest.TestCase): | ||
|
||
def setUp(self): | ||
|
||
# Get a list of processor definition files in the code repository | ||
self.l3_output_files = psrlcfg.get_settings_files("output", "l3") | ||
|
||
def testYamlSyntaxOfDefinitionFiles(self): | ||
for filename in self.l3_output_files: | ||
content = get_yaml_config(filename) | ||
self.assertIsInstance(content, AttrDict, msg=filename) | ||
|
||
|
||
if __name__ == '__main__': | ||
suite = unittest.TestLoader().loadTestsFromTestCase(TestL3OutputDef) | ||
unittest.TextTestRunner(verbosity=2).run(suite) |
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,35 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Testing all Level-2 processor definition files for compabilility with | ||
Level2Processor conventions | ||
@author: Stefan Hendricks | ||
""" | ||
|
||
import yaml | ||
import unittest | ||
from attrdict import AttrDict | ||
|
||
from pysiral import psrlcfg | ||
from pysiral.config import get_yaml_config | ||
from pysiral.l2proc.procsteps import Level2ProcessorStepOrder | ||
from loguru import logger | ||
logger.disable("pysiral") | ||
|
||
|
||
class TestL3ProcDef(unittest.TestCase): | ||
|
||
def setUp(self): | ||
|
||
# Get a list of processor definition files in the code repository | ||
self.l2procdef_files = psrlcfg.get_settings_files("proc", "l3") | ||
|
||
def testYamlSyntaxOfDefinitionFiles(self): | ||
for filename in self.l2procdef_files: | ||
content = get_yaml_config(filename) | ||
self.assertIsInstance(content, AttrDict, msg=filename) | ||
|
||
|
||
if __name__ == '__main__': | ||
suite = unittest.TestLoader().loadTestsFromTestCase(TestL3ProcDef) | ||
unittest.TextTestRunner(verbosity=2).run(suite) |