Package: woudc-qa
WOUDC Quality Assessment libraryPython package for automatically quality assessingWOUDCdata based on defined rules.InstallationRequirementswoudc-qa requires Python 2.7.DependenciesSeerequirements.txt.Installing the Package# via distutilspipinstall-rrequirements.txtpythonsetup.pyinstallUsageCommand line interfaceusage:woudc-qa.py[-h]--fileFILEExecuteQa.optionalarguments:-h,--helpshowthishelpmessageandexit--fileFILEPathtoextendedCSVfiletobequalityassessed.Examplesfromwoudc_qaimportqafile_s=open(<pathtoyourextendedCSVfile.>).read()qa_results=qa(file_s)# qa_results is a dictionary as such:# qa_results: {#     filename: {#        test_id: {#            row : {#                result: result of this test, pass/fail/None/NR,#                table: table name,#                table_index: table_index,#                element: element name,#                related_test_id: test_id,#                related_test_result: related tests result, pass/fail/None/NR#                precond : precondition result: pass/fail/None/NR#            }#        }#    }# }# where,# 'filename' is the name of the file, default it to 'file1'# 'test_id' is the test identifier from the test definition# 'row' is the row number of the element under assessmet. Always 1 for non profile/payload element# 'result', is the result of the assessment for the element at the indicated row for the given test# 'table' is the name of the table where the element under assessment is found# 'table_index' is the index of the above table. Default to 1, index will be incremented by 1 to handle multicipity# 'element' is the element under assessment# 'related_test_id' is a listing of any related test to this test# 'related_test_result' is a aggregated result of all related tests to this test# 'precond' is the aggregated result of any precondition checks## from collections import OrderedDict# test_result = qa_result[<filename>][<test_id>]# iterate over test results by row:# for row, result in test_result.iteritems():#    print row, result# get result of assessment at a specific row# row_result = qa_results[<filename>][<test_id>][<row number>]['result']DevelopmentFor development environments, install in a Pythonvirtualenv:virtualenvfoocdfoo.bin/activate# fork master
# fork http://github.com/woudc/woudc-qa on GitHub
# clone your fork to create a branchgitclonehttps://github.com/{yourGitHubusername}/woudc-qa.gitcdwoudc-qa# install dev packagespipinstall-rrequirements.txtpythonsetup.pyinstall# create upstream remotegitremoteaddupstreamhttps://github.com/woudc/woudc-qa.gitgitpullupstreammastergitbranchmy-cool-featuregitcheckoutmy-cool-feature# start devgitcommit-m'implement cool feature'# push to your forkgitpushoriginmy-cool-feature# issue Pull Request on GitHubgitcheckoutmaster# cleanup/update once your branch is merged on GitHub
# remove branchgitbranch-Dmy-cool-feature# update your forkgitpullupstreammastergitpushoriginmasterRunning Tests# via distutilspythonsetup.pytest# manuallypythonrun_tests.py# report test coveragecoveragerun--sourcewoudc_qasetup.pytestcoveragereport-mCode Conventionswoudc_qa code conventions are as perPEP8.# code should always pass the followingfind-typef-name"*.py"|xargsflake8IssuesAll bugs, enhancements and issues are managed onGitHub.HistoryContactThinesh
Sornalingam