paradimdata / project_chameleon

Repository for Project Chameleon conversion scripts
MIT License
4 stars 1 forks source link

Enable using cps in API calls #26

Closed tmcqueen-materials closed 2 weeks ago

tmcqueen-materials commented 2 weeks ago

The changes to resolve #17 added the new parameter cps to the brukerrawconverter backend. This is great.

It would be good if cps can be toggled by a caller to the front-end fastAPI. I believe that means replacing https://github.com/paradimdata/project_chameleon/blob/283ef7fcd540c375c5dbfca391005daf407fc38d/api.py#L443

with something like:

        cps = None
        if 'cps' in data:
            if data['cps']:
                cps = True
            else:
                cps = False
        brukerrawconverter(input_file, output_file, cps)

This does not go in the common handler because it is specific to this call.

pcauchy1 commented 2 weeks ago

Not sure how I forgot this but it is in there now