Closed nsheff closed 3 months ago
Regarding clutter in return value:
The above example (>>> psm["sample2"]
) is a simple wrapper around retrieve_one
:
https://github.com/pepkit/pipestat/blob/1fe44eb33b353f9b2ea927cd58f604c39e53db54/pipestat/pipestat.py#L285-L288
retrieve_one
currently returns everything for that record unless you specify result identifiers.
Regarding
why can't retrieve use the class record identifier?
With the above example, psm.retrieve_one("value")
, pipestat thinks that value is the record_identifier.
However, if I attempt to specify the arguments, result = psm.retrieve_one(result_identifier="value")
, I see that there is a problem and pipestat is not pulling the class record_identifier
appropriately.
psm1 = PipestatManager(record_identifier="RECORD1", schema_path="sample_output_schema.yaml", results_file_path="results.yaml", pipeline_type="sample")
psm1.report(values={"number_of_things": 100})
result = psm1.retrieve_one(result_identifier="number_of_things")
Error
File "/home/drc/PythonProjects/pipestat/opt_dependencies/venv6/lib/python3.10/site-packages/pipestat/pipestat.py", line 708, in retrieve_one
raise RecordNotFoundError(
pipestat.exceptions.RecordNotFoundError: Results '['number_of_things']' for 'None' not found
Regarding
Reporting result is returning a list
It appears that this was intentional: https://github.com/pepkit/pipestat/commit/acf3a545c1fccd012a5ac12e50b79224129417e7
We wanted to return formatted results. For example, I know that PyPiper takes this returned formatted value and logs it. Is there an issue with it being a list? Should we just concatenate the formatted results into one big string?
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.
I've made associated issues for initial comment, so I will mark this specific issue as solved (close it) and work on the child issues.
clutter in return value
It's distracting that every time I retrieve a value, I get all this other stuff (created time, modified time, record identifier):
I would expect it to just say:
why can't retrieve use the class record identifier?
I can do this:
It knows to put it on the record id I started with. But then why doesn't this work?
That's confusing to me
docs are wrong
following the tutorial, docs say this:![image](https://github.com/pepkit/pipestat/assets/5271009/484ef0d5-86f7-43f8-9233-c6094bfdee20)
But I don't get
None
-- I get an exception:There are many other problems with the tutorial. Someone needs to actually go through it and run it. https://pep.databio.org/pipestat/code/python-tutorial/
Reporting result is returning a list