pepkit / pipestat

Pipeline results reporting package
https://pep.databio.org/pipestat/
BSD 2-Clause "Simplified" License
4 stars 2 forks source link

Rethink how pipestat returns reported results #176

Closed donaldcampbelljr closed 3 months ago

donaldcampbelljr commented 3 months ago
          > We wanted to return formatted results. 

I think the return value of the report function should not be a list of strings. It should be some recognition about what was reported that is machine-understandable. There could be a separate function to take that programmatic output and produce a formatted string if that's what someone wants.

generally you want a function to return something that can be used more universally, unless the whole point of the function is just to format a string.

Originally posted by @nsheff in https://github.com/pepkit/pipestat/issues/158#issuecomment-2037611997

donaldcampbelljr commented 3 months ago

In ~ June 2023, we decided to take values as they were being reported by pipestat, run them through a result_formatting function, append them to a list and then return that list: Major Commit https://github.com/pepkit/pipestat/commit/acf3a545c1fccd012a5ac12e50b79224129417e7

https://github.com/pepkit/pipestat/blob/1fe44eb33b353f9b2ea927cd58f604c39e53db54/pipestat/backends/file_backend/filebackend.py#L378-L387

Built-in results formatter (but the user can pass others if they like): https://github.com/pepkit/pipestat/blob/1fe44eb33b353f9b2ea927cd58f604c39e53db54/pipestat/helpers.py#L134-L152

nsheff commented 3 months ago

Ok, if you think this is the best way.