Skip to content

Conversation

@kaustubhmote
Copy link
Collaborator

@kaustubhmote kaustubhmote commented Dec 31, 2025

A function update_uc is added to fileiobase to update an existing unit_conversion object. This resolves #219. It will work something like this in practice:

dic, data  = ng.bruker.read(filepath)
udic = ng.bruker.guess_udic(dic, data)
uc = ng.fileiobase.uc_from_udic(udic)

new_car = uc._car + 10 
uc_new = ng.fileiobase.update_uc(uc, car=new_car) 

# sw, obs, cplx, size can also be updated in a similar manner 

I thought about implementing this in the object oriented interface (uc.update(car=new_car), but maybe this functional way is better for the usual reason of avoiding side effects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Roll data and update unit conversion object

1 participant