Created
May 5, 2023 22:17
-
-
Save jmmshn/2d69dae866cad191597d6014c4a71e08 to your computer and use it in GitHub Desktop.
[update fireworks database] check the structure charge and update the charge #fireworks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for doc in FW_STORE.query({ | |
"spec._tasks.0.job.function_args.0.charge": {"$exists": 1}, | |
"spec._tasks.0.job.function.@bound.write_additional_data.info:json": {"$exists": 1}, | |
# "fw_id" : {"$gt" : 1000} | |
} | |
): | |
chg_structure = doc["spec"]["_tasks"][0]["job"]["function_args"][0]["charge"] | |
chg_defect = doc["spec"]["_tasks"][0]["job"]["function"]["@bound"]["write_additional_data"]["info:json"]["charge_state"] | |
if chg_structure != chg_defect: | |
print('messed', doc["fw_id"]) | |
FW_STORE._collection.update_one( | |
{"_id": doc["_id"]}, | |
{"$set": {"spec._tasks.0.job.function_args.0.charge": int(chg_defect)}}, | |
) | |
LPAD.rerun_fw(doc["fw_id"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment