Rename stripNamespace strip_namespace
authorDiane Trout <diane@ghic.org>
Wed, 8 Jan 2014 18:03:05 +0000 (10:03 -0800)
committerDiane Trout <diane@ghic.org>
Wed, 8 Jan 2014 18:03:05 +0000 (10:03 -0800)
htsworkflow/pipelines/sequences.py
htsworkflow/submission/condorfastq.py
htsworkflow/submission/geo.py
htsworkflow/submission/submission.py
htsworkflow/submission/trackhub_submission.py
htsworkflow/util/rdfhelp.py
htsworkflow/util/test/test_rdfhelp.py

index 87212dddbb0acda92894cf49fec9937b7f2d9e21..2aba7099915b95fe0f2097e4445c42dd9b805941 100644 (file)
@@ -12,7 +12,7 @@ from urlparse import urljoin, urlparse
 import RDF
 from htsworkflow.util.rdfhelp import libraryOntology as libNS
 from htsworkflow.util.rdfhelp import toTypedNode, fromTypedNode, rdfNS, \
-     stripNamespace, dump_model, simplify_uri
+     strip_namespace, dump_model, simplify_uri
 
 LOGGER = logging.getLogger(__name__)
 
@@ -222,7 +222,7 @@ class SequenceFile(object):
             raise KeyError(u"%s not found" % (unicode(seq_id),))
 
         seq_type_node = model.get_target(seq_id, libNS['file_type'])
-        seq_type = stripNamespace(libNS, seq_type_node)
+        seq_type = strip_namespace(libNS, seq_type_node)
 
         path = urlparse(str(seq_id.uri)).path
         flowcellNode = get_one(seq_id, libNS['flowcell'])
index 17e463351282b7b8091f922760e8b1fd69a2c934..ffbd8e0704356f4798d2dfb3790734bdcc782c9c 100644 (file)
@@ -16,7 +16,7 @@ from htsworkflow.pipelines import desplit_fastq
 from htsworkflow.submission.fastqname import FastqName
 from htsworkflow.util.rdfhelp import get_model, dump_model, load_into_model, \
      fromTypedNode, \
-     stripNamespace
+     strip_namespace
 from htsworkflow.util.rdfns import *
 from htsworkflow.util.conversion import parse_flowcell_id
 
@@ -347,7 +347,7 @@ class SequenceResult(object):
     ispaired = property(_get_ispaired)
 
     def _get_filetype(self):
-        return stripNamespace(libraryOntology, self._filetype)
+        return strip_namespace(libraryOntology, self._filetype)
     filetype = property(_get_filetype)
 
     def _get_path(self):
index ef8d9457218a76ce53f0872f44efafd6d478dea1..1d98bd5c9550e36408b3ba4faed02ee8d28cedee 100644 (file)
@@ -8,7 +8,7 @@ from htsworkflow.submission.submission import Submission
 from htsworkflow.util.rdfhelp import \
      fromTypedNode, \
      geoSoftNS, \
-     stripNamespace, \
+     strip_namespace, \
      submissionOntology
 
 from django.conf import settings
@@ -207,7 +207,7 @@ class GEOSubmission(Submission):
     def query_to_soft_dictionary(self, results, heading):
         attributes = []
         for r in results:
-            name = stripNamespace(geoSoftNS, r['name'])
+            name = strip_namespace(geoSoftNS, r['name'])
             if name is not None:
                 if name.lower() == heading.lower():
                     name = '^' + name
index c5a3f34b76c20aaae69cdb254b92e47190697752..5077996b8abb535e8aeb9bae2409d0f0f2fede09 100644 (file)
@@ -11,7 +11,7 @@ from htsworkflow.util.rdfhelp import \
      dump_model, \
      fromTypedNode, \
      get_model, \
-     stripNamespace, \
+     strip_namespace, \
      toTypedNode
 from htsworkflow.util.rdfns import *
 from htsworkflow.util.hashfile import make_md5sum
@@ -390,7 +390,7 @@ def list_submissions(model):
     query = RDF.SPARQLQuery(query_body)
     rdfstream = query.execute(model)
     for row in rdfstream:
-        s = stripNamespace(submissionLog, row['submission'])
+        s = strip_namespace(submissionLog, row['submission'])
         if s[-1] in ['#', '/', '?']:
             s = s[:-1]
         yield s
index e383175a16884c3d1d24a69042bf916a44aa71c9..131bb15b3d215c50fe2c104b75b72b968a3b4a03 100644 (file)
@@ -11,7 +11,6 @@ from htsworkflow.submission.submission import Submission
 from htsworkflow.util.rdfhelp import \
      fromTypedNode, \
      geoSoftNS, \
-     stripNamespace, \
      submissionOntology
 from htsworkflow.util.url import parse_ssh_url
 from htsworkflow.util.ucsc import bigWigInfo
index ac5f6ccd1056a561418cd9b17e155ee936097630..4f65d7d44885ad0c16bbe1ade6604ba2b5a42700 100644 (file)
@@ -214,7 +214,7 @@ def simplify_uri(uri):
                 return element
     raise ValueError("Unable to simplify %s" % (uri,))
 
-def stripNamespace(namespace, term):
+def strip_namespace(namespace, term):
     """Remove the namespace portion of a term
 
     returns None if they aren't in common
index 3f328d8d18b43b8ec5bd80fb5f2f4a70501b67a8..2f141904f830183d309720b4629205a2c9bdf67d 100644 (file)
@@ -19,7 +19,7 @@ from htsworkflow.util.rdfhelp import \
      rdfsNS, \
      remove_schemas, \
      toTypedNode, \
-     stripNamespace, \
+     strip_namespace, \
      simplify_uri, \
      sanitize_literal, \
      xsdNS
@@ -121,17 +121,17 @@ try:
 
             term = 'foo'
             node = nsOrg[term]
-            self.assertEqual(stripNamespace(nsOrg, node), term)
-            self.assertEqual(stripNamespace(nsCom, node), None)
-            self.assertEqual(stripNamespace(nsOrg, node.uri), term)
+            self.assertEqual(strip_namespace(nsOrg, node), term)
+            self.assertEqual(strip_namespace(nsCom, node), None)
+            self.assertEqual(strip_namespace(nsOrg, node.uri), term)
 
         def test_strip_namespace_exceptions(self):
             nsOrg = RDF.NS('example.org/example#')
             nsCom = RDF.NS('example.com/example#')
 
             node = toTypedNode('bad')
-            self.assertRaises(ValueError, stripNamespace, nsOrg, node)
-            self.assertRaises(ValueError, stripNamespace, nsOrg, nsOrg)
+            self.assertRaises(ValueError, strip_namespace, nsOrg, node)
+            self.assertRaises(ValueError, strip_namespace, nsOrg, nsOrg)
 
         def test_simplify_uri(self):
             DATA = [('http://asdf.org/foo/bar', 'bar'),