G-Node / G-Node/python-odml

Create to_quantity() method for numerical properties

オープン
#362 コメント 0 件 リアクション 0 件 担当者 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 を短くまとめたダイジェスト。