Skip to content

Commit

Permalink
Merge pull request #30 from cmaumet/130_followup
Browse files Browse the repository at this point in the history
Export to NIDM-Results 1.3.0
  • Loading branch information
Camille Maumet authored Jun 14, 2016
2 parents cbd262f + 09d6520 commit a2025ac
Show file tree
Hide file tree
Showing 69 changed files with 18,146 additions and 60,744 deletions.
11 changes: 1 addition & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,4 @@ script:
- cat debug.log
before_install:
- git config --global user.name "TravisCI"
- git config --global user.email "travis@dummy.com"
# Create subtree nidm from main nidm repository
- git remote add nidm https://github.com/cmaumet/nidm.git
# - git remote add nidm_cmaumet https://github.com/cmaumet/nidm.git
- git fetch nidm
- git fetch nidm --tags
# - git fetch nidm_cmaumet
- git subtree add --prefix nidm nidm/1.3.0-rc2 --squash
- git subtree add --prefix nidm_releases/1.0.0 nidm tags/NIDM-Results_1.0.0 --squash
- git subtree add --prefix nidm_releases/1.1.0 nidm tags/NIDM-Results_1.1.0 --squash
- git config --global user.email "travis@dummy.com"
44 changes: 12 additions & 32 deletions TestSPMResultDataModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,9 @@
logger = logging.getLogger(__name__)
logger.info(' ---------- Debug log ----------')

import sys
RELPATH = os.path.dirname(os.path.abspath(__file__))

# Add nidm common testing code folder to python path
NIDM_DIR = os.path.join(RELPATH, "nidm")

# In TravisCI the nidm repository will be created as a subtree, however locally
# the nidm directory will be accessed directly
logging.debug(NIDM_DIR)
if not os.path.isdir(NIDM_DIR):
NIDM_DIR = os.path.join(RELPATH, "..", "nidm")
logging.debug(NIDM_DIR)

NIDM_RESULTS_DIR = os.path.join(NIDM_DIR, "nidm", "nidm-results")
sys.path.append(os.path.join(NIDM_RESULTS_DIR, "test"))

from TestResultDataModel import TestResultDataModel
from TestCommons import *
from CheckConsistency import *
from nidmresults.test.test_results_doc import TestResultDataModel
from nidmresults.test.test_commons import *
from nidmresults.test.check_consistency import *
from ddt import ddt, data

TEST_DIR = os.path.dirname(os.path.abspath(__file__))
Expand All @@ -61,17 +45,9 @@ def setUp(self):
level=logging.DEBUG,
format='%(asctime)s - %(levelname)s - %(message)s')

# Retreive owl file for NIDM-Results
owl_file = os.path.join(NIDM_RESULTS_DIR, 'terms', 'nidm-results.owl')
# Retreive imported owl files from NIDM-Results
owl_imports = glob.glob(os.path.join(
os.path.dirname(owl_file),
os.pardir, os.pardir, "imports", '*.ttl'))

gt_dir = os.path.join(TEST_DIR, 'spmexport', 'ground_truth')

TestResultDataModel.setUp(self, owl_file, owl_imports, test_files,
TEST_DIR, gt_dir)
TestResultDataModel.setUp(self, gt_dir)

# @data(*test_files)
# def test_class_consistency_with_owl(self, ttl):
Expand All @@ -85,7 +61,8 @@ def setUp(self):
# @data(*test_files)
# def test_attributes_consistency_with_owl(self, ttl):
# """
# Test: Check that the attributes used in the ttl file comply with their
# Test: Check that the attributes used in the ttl file comply with
# their
# definition (range, domain) specified in the owl file.
# """
# ex = self.load_graph(ttl)
Expand All @@ -99,15 +76,18 @@ def test_examples_match_ground_truth(self, ttl):
"""
ex = self.load_graph(ttl)
ex_gt = ""

# Creating a single ground truth graph (by merging all included ground
# truths)
gt = Graph()
for gt_file in ex.gt_ttl_files:
logging.info("Ground truth ttl: " + gt_file)

# RDF obtained by the ground truth export
gt = Graph()
gt.parse(gt_file, format='turtle')

self.compare_full_graphs(gt, ex.graph, ex.exact_comparison, False)
ex_gt += self.my_execption
self.compare_full_graphs(gt, ex.graph, ex.exact_comparison, False)
ex_gt += self.my_execption

if ex_gt:
raise Exception(ex_gt)
Expand Down
Loading

0 comments on commit a2025ac

Please sign in to comment.