First version of obicleandb...

Former-commit-id: e60b61d015abbf029a555b51de99b4252c50ab59
This commit is contained in:
Eric Coissac
2024-07-01 17:12:42 +02:00
parent 0187a82c5f
commit fd663357b5
4 changed files with 168 additions and 3 deletions

View File

@ -172,6 +172,26 @@ func (s *BioSequence) GetIntAttribute(key string) (int, bool) {
return val, ok
}
func (s *BioSequence) GetFloatAttribute(key string) (float64, bool) {
var val float64
var err error
v, ok := s.GetAttribute(key)
if ok {
val, ok = v.(float64)
if !ok {
val, err = obiutils.InterfaceToFloat64(v)
ok = err == nil
if ok {
s.SetAttribute(key, val)
}
}
}
return val, ok
}
// DeleteAttribute deletes the attribute with the given key from the BioSequence.
//
// Parameters: