Commit d38d6ac6 authored by Edward Fauchon-Jones's avatar Edward Fauchon-Jones
Browse files

Add base class for interfield spec + errors

parent 3758fbb4
......@@ -44,6 +44,15 @@ class Valid(Error):
name = "="
class ValidInterfield(Error):
"""No error for interfield"""
name = "="
msg = "({0:s})"
def __init__(self, spec):
self.msg = self.msg.format(spec.validMsg)
class InvalidValue(Error):
"""Defined value is not a value the field may take"""
......@@ -96,3 +105,12 @@ class InvalidModeName(Error):
def __init__(self, spec):
self.msg = self.msg.format(spec.m, spec.l)
class InvalidInterfield(Error):
"""Interfield check has failed"""
msg = "({0:s})"
def __init__(self, spec):
self.msg = self.msg.format(spec.invalidMsg)
......@@ -170,6 +170,19 @@ class ROMSplineSpec(Spec):
group.create_dataset(sub, data=data)
class InterfieldSpec(Spec):
"""Specification for relationship between mutliple fields"""
dtype = basestring
validMsg = "(Relationship betwen fields is valid)"
invalidMsg = "(Relationship betwen fields is valid)"
def valid(self, sim):
return err.ValidInterfield(self)
def createField(self, sim):
# General Fields
class Type(Spec):
"""Specification for the `type` field"""
Markdown is supported
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