simphony / simphony-osp

A framework that aims to achieve interoperability between software such as simulation engines, databases and data repositories using a knowledge graph as the common language.
https://simphony.readthedocs.io
Other
16 stars 12 forks source link

Name change of files at the client side – prepended with a hash #649

Closed aje08106 closed 3 years ago

aje08106 commented 3 years ago

Suppose the file tensile_test_data_output.txt belongs to mt.text_report_file which is a sub-class of cuba.file, the line of code wrapper.session.load_by_oclass(mt.text_report_file) loads the cuds object and downloads the result file to the dowload directory at once. (Connected via DataspaceSession)

But the file name gets changed to something like 5e6aed06692b4d308b8e523633f06bd0-tensile_test_data_output.txt(prepended with a hash - maybe hash of file or uuid) causing difficulty in identifying the files at client-side. Just because of that, an extra piece of code has to be written at the client side just to remove those hashes. Would be more convenient if we get file names without prepended hash in the results folder.

kysrpex commented 3 years ago

In PR #664, I changed the behaviour. You will not find the uid of the CUDS prepended.

However, if you create two file CUDS objects that refer to different files (meaning that their contents are not identical) that have the same name, then you will find a uid in the name of the second file, like this: file (7050a16f-ab03-4d55-a933-1ab1468ec345).extension. As I said, this will only happen when there is both a name and content conflict.

If you want to restore the old behaviour, instantiate the TransportSessionClient with the keyword argument file_uid=True.