G-Node / G-Node/python-odml

Create to_quantity() method for numerical properties

Abierto
#362 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
25
Forks
30
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.