simphony / docs

Documentation of the SimPhoNy Open Simulation Platform.
https://simphony.readthedocs.io
BSD 3-Clause "New" or "Revised" License
3 stars 4 forks source link

Introduce a practical EMMO guide #141

Open yoavnash opened 3 years ago

yoavnash commented 3 years ago

How to

yoavnash commented 3 years ago

Add a numerical value:

from osp.core.namespaces import math, metrology, my_namespace

value=5
c = my_namespace.MyClass()
real_number = math.Real(hasNumericalData=value)
c.add(real_number, rel=metrology.hasQuantityValue)
yoavnash commented 3 years ago

Add a string value:

from osp.core.namespaces import math, metrology, my_namespace

value='cowabunga'
c = my_namespace.MyClass()
symbol = perceptual.Symbol(hasSymbolData=value)
c.add(symbol, rel=metrology.hasQuantityValue)
yoavnash commented 3 years ago

@JoanaFMorgado Do you think this could fit better in the EMMO docs? (GitHub / GitLab)

yoavnash commented 3 years ago

Another option: add this info as a part of an EMMO use case that builds on previous tutorials and use such tutorial to better connect it with materials science.