Composite/String Composite Python Script Versioning

57 views
Skip to first unread message

Peter Truong

unread,
May 29, 2024, 8:43:20 AMMay 29
to QATrack+

Hello there,

Our hospital just had our first experience receiving a test pack of test lists from another hospital as a reference in implementing Pylinac analysis in our QATrack workflow. This got me thinking on the importance of managing/maintaining the versioning/up-to-date aspect for the scripts (composite/string composite tests) embedded into our QATrack environment.
However, going through each composite/string composite test and then copy-pasting the script portion into a new python script text file would seem like tedious chore to do (given that there are about a thousand tests with a scripting component - albeit often only 2-3 lines of code). So, obviously, the exported test pack that we received peaked out interest quite a bit.

My question would be on if there was a way to explore the contents of the exported test pack (.tpk file) in order to quickly extract the scripting portion of the composite/string composite tests that we would export (filtered). The idea would be to have them (hopefully organized in by test list) saved as python scripts and then to be versioned with Git afterwards. Once versioned, any changes made to the QATrack side can be re-exported and then tested against the Git version to ensure that there have been no other changes (name, variables, script) across all the files.

Has anyone else had any experience with working with the .tpk files outside of QATrack (possibly in a Windows environment)?
And/or have I missed any documentation that clearing dictates how to do this (if so, whoops...)?
Thanks in advance!

Cheers,
Peter

tbe...@gmail.com

unread,
May 31, 2024, 4:36:44 AMMay 31
to QATrack+
Hi Peter,

the tpk. files are just json formatted text files (you can open them with any editor), so you technically can use any language to parse the tpk files.
Regarding the git versioning, have a look at the radformation testpack github repository, they are basically doing just that directly with the tpk files.

regards
Thomas

Peter Truong

unread,
Jun 3, 2024, 9:41:10 AMJun 3
to QATrack+
Hello Thomas, 

I had initially thought that they were some sort of compressed files, but when trying to explore its contents with various zipping applications, I hit a roadblock real fast (but it all makes sense now). 
After reviewing the radformation test pack github repository (as recommended), it seems that it's also possible to simply load up/commit entire .tpk files for versioning and tracking changes (as it's already being parsed as text). 
This might be the route that we take (or to parse in python creating individual .py files based on the "calculation_procedure" JSON tag). 

Interesting! Thanks for this clarification/explanation on the .tpk file structure. 

Cheers,
Peter
Reply all
Reply to author
Forward
0 new messages