Closed gelzinyte closed 3 years ago
Because string values need to be in quotes (I.e 'dset_type="train"') if this is a massive pain we can think about special casing it. But in queries, it's a nightmare if you don't do this
-- Gábor
On 6 Apr 2021, at 09:43, gelzinyte @.***> wrote:
e.g. abcd upload -i -e "dset_type=train" train.xyz gets parsed into {'dset_type': Tree('value', []), 'train': True} and Tree cannot be hashed. Full Traceback:
Traceback (most recent call last): File "/opt/womble/miniconda3/user_envs/eg475/wo/bin/abcd", line 33, in
sys.exit(load_entry_point('abcd', 'console_scripts', 'abcd')()) File "/home/eg475/programs/abcd/abcd/frontends/commandline/parser.py", line 121, in main callback_func(kwargs) File "/home/eg475/programs/abcd/abcd/frontends/commandline/decorators.py", line 15, in wrapper func(*args, config=config, *kwargs) File "/home/eg475/programs/abcd/abcd/frontends/commandline/decorators.py", line 48, in wrapper func(args, db=db, query=query, kwargs) File "/home/eg475/programs/abcd/abcd/frontends/commandline/decorators.py", line 59, in wrapper func(*args, **kwargs) File "/home/eg475/programs/abcd/abcd/frontends/commandline/commands.py", line 69, in upload db.upload(path, extra_infos, store_calc=calculator) File "/home/eg475/programs/abcd/abcd/backends/atoms_pymongo.py", line 230, in upload self.push(data, extra_info, store_calc=store_calc) File "/home/eg475/programs/abcd/abcd/backends/atoms_pymongo.py", line 214, in push data = AtomsModel.from_atoms(self.collection, item, extra_info=extra_info, store_calc=store_calc) File "/home/eg475/programs/abcd/abcd/backends/atoms_pymongo.py", line 46, in from_atoms obj = super().from_atoms(atoms, extra_info, store_calc) File "/home/eg475/programs/abcd/abcd/model.py", line 202, in from_atoms item.pre_save() File "/home/eg475/programs/abcd/abcd/model.py", line 276, in pre_save m.update(self[key]) File "/home/eg475/programs/abcd/abcd/model.py", line 47, in update raise ValueError("The {} type cannot be hashed! (Value: {})", format(type(value), value)) TypeError: format() argument 2 must be str, not Tree — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Ah ok, just forgot about it (even though it's mentioned further down in the examples). Thanks!
e.g.
abcd upload -i -e "dset_type=train" train.xyz
gets parsed into{'dset_type': Tree('value', []), 'train': True}
andTree
cannot be hashed. Full Traceback: