G-Node / G-Node/python-odml

Create to_quantity() method for numerical properties

未关闭
#362 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
25
派生
30
PR 合并指标
30 天内没有已合并 PR

描述

Hi!

I have encountered myself doing the following many, many times:
```
import quantities as pq
myQuantity = pq.Quantity(myOdml.properties['myProp'].value,
myOdml.properties['myProp'].unit)
```

So I wondered this is probably something people would expect odml to do for them. My suggestion would be a method of the property class that apart from doing the above also checks some stuff like:
* If quantities is installed
* If units are specified
* If the units are compatible with quantities units
* If the value is actually numerical
* ...

And returns appropriate warnings/errors when the requirements are not met.

Let me know your thoughts!
Aitor

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。