# Path: lems/base/util.py
# def validate_lems(file_name):
# 
#     from lxml import etree
# 
#     try:
#         from urllib2 import urlopen  # Python 2
#     except:
#         from urllib.request import urlopen  # Python 3
# 
#     schema_file = urlopen(__schema_location__)
#     xmlschema = etree.XMLSchema(etree.parse(schema_file))
#     print("Validating {0} against {1}".format(file_name, schema_file.geturl()))
#     xmlschema.assertValid(etree.parse(file_name))
#     print("It's valid!")


import lems.api as lems
from lems.base.util import validate_lems
#! /usr/bin/python


model = lems.Model()

model.add(lems.Dimension("voltage", m=1, l=3, t=-3, i=-1))
model.add(lems.Dimension("time", t=1))
model.add(lems.Dimension("capacitance", m=-1, l=-2, t=4, i=2))

model.add(lems.Unit("milliVolt", "mV", "voltage", -3))

# Path: lems/base/util.py
# def validate_lems(file_name):
# 
#     from lxml import etree
# 
#     try:
#         from urllib2 import urlopen  # Python 2
#     except:
#         from urllib.request import urlopen  # Python 3
# 
#     schema_file = urlopen(__schema_location__)
#     xmlschema = etree.XMLSchema(etree.parse(schema_file))
#     print("Validating {0} against {1}".format(file_name, schema_file.geturl()))
#     xmlschema.assertValid(etree.parse(file_name))
#     print("It's valid!")


# Path: examples/apitest2.py
import lems.api as lems
from lems.base.util import validate_lems

#! /usr/bin/python


model = lems.Model()

model.add(lems.Dimension("voltage", m=1, l=3, t=-3, i=-1))
model.add(lems.Dimension("time", t=1))
model.add(lems.Dimension("capacitance", m=-1, l=-2, t=4, i=2))

model.add(lems.Unit("milliVolt", "mV", "voltage", -3))

model.add(lems.Unit("milliSecond", "ms", "time", -3))