G-Node / G-Node/python-odml

Create to_quantity() method for numerical properties

Đang mở
#362 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
25
Fork
30
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.