You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A prefix variable is used in DirectoryPaths to store files in sub-directories:
def save_json(self, name, object_dict: Union[dict, list], prefix : str = ""):
"""
Save a dictionary as a json file in the jsons directory of the search.
Parameters
----------
name
The name of the json file
object_dict
The dictionary to save
prefix
A prefix to add to the path which is the name of the folder the file is saved in.
"""
with open_(self._path_for_json(name, prefix), "w+") as f:
json.dump(object_dict, f, indent=4)
This means that the files folder has a sub-folder named the prefix and when loading from the aggregator we specify this folder:
data = aa.Array2D.from_primary_hdu(primary_hdu=fit.value(name="dataset.data"))
Can we implement the prefix in all DatabasePaths functions so it is stored in a sub folder in the .sqlite database? Is this a sensible thing to do? We want the API to mimick that of DirectoryPaths so the same function:
data = aa.Array2D.from_primary_hdu(primary_hdu=fit.value(name="dataset.data"))
Can be called irrespective of whether the database was run as a session or built via scrape.
The text was updated successfully, but these errors were encountered:
Traceback (most recent call last):
File "/mnt/c/Users/Jammy/Code/PyAuto/autofit_workspace_test/scripts/database/session/general.py", line 170, in <module>
for data in agg.values("dataset.data"):
File "/mnt/c/Users/Jammy/Code/PyAuto/PyAutoFit/autofit/database/aggregator/aggregator.py", line 120, in values
value = fit[name]
File "/mnt/c/Users/Jammy/Code/PyAuto/PyAutoFit/autofit/database/model/fit.py", line 310, in __getitem__
return getattr(self, item)
AttributeError: 'Fit' object has no attribute 'dataset.data'
A
prefix
variable is used inDirectoryPaths
to store files in sub-directories:This means that the
files
folder has a sub-folder named theprefix
and when loading from the aggregator we specify this folder:data = aa.Array2D.from_primary_hdu(primary_hdu=fit.value(name="dataset.data"))
Can we implement the
prefix
in allDatabasePaths
functions so it is stored in a sub folder in the .sqlite database? Is this a sensible thing to do? We want the API to mimick that ofDirectoryPaths
so the same function:data = aa.Array2D.from_primary_hdu(primary_hdu=fit.value(name="dataset.data"))
Can be called irrespective of whether the database was run as a session or built via scrape.
The text was updated successfully, but these errors were encountered: