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
---------------------------------------------------------------------------HTTPErrorTraceback (mostrecentcalllast)
CellIn[8], line2321key=f"matsciopt-{task_name}-benchmark-dataset"22access_token=ZENODO_SANDBOX_API_KEYifsandboxelseZENODO_API_KEY--->23res=ensure_zenodo(
24key,
25data=data,
26paths=[
27f"data/processed/{task_name}/sobol_probability_filter.csv",
28f"data/processed/{task_name}/sobol_regression.csv",
29f"data/processed/{task_name}/model_metadata.json",
30f"models/{task_name}/surrogate_models.pkl",
31f"models/{task_name}/cross_validation_models_0.pkl",
32f"models/{task_name}/cross_validation_models_1.pkl",
33f"models/{task_name}/cross_validation_models_2.pkl",
34f"models/{task_name}/cross_validation_models_3.pkl",
35f"models/{task_name}/cross_validation_models_4.pkl",
36 ],
37sandbox=sandbox, # remove this when you're ready to upload to real Zenodo38access_token=access_token,
39 )
40frompprintimportpprint42pprint(res.json())
Filec:\Users\sterg\Miniconda3\envs\matsci-opt-benchmarks\lib\site-packages\zenodo_client\api.py:37, inensure_zenodo(key, data, paths, **kwargs)
35defensure_zenodo(key: str, data: Data, paths: Paths, **kwargs) ->requests.Response:
36"""Create a Zenodo record if it doesn't exist, or update one that does."""--->37returnZenodo(**kwargs).ensure(key=key, data=data, paths=paths)
Filec:\Users\sterg\Miniconda3\envs\matsci-opt-benchmarks\lib\site-packages\zenodo_client\api.py:101, inZenodo.ensure(self, key, data, paths)
98logger.info("mapped local key %s to deposition %s", key, deposition_id)
99returnself.update(deposition_id=deposition_id, paths=paths)
-->101res=self.create(data=data, paths=paths)
102# Write the ID to the key in the local configuration103# so it doesn't need to be created from scratch next time104pystow.write_config(self.module, key, str(res.json()["id"]))
Filec:\Users\sterg\Miniconda3\envs\matsci-opt-benchmarks\lib\site-packages\zenodo_client\api.py:126, inZenodo.create(self, data, paths)
117data= {
118"metadata": {key: valueforkey, valueindata.dict(exclude_none=True).items() ifvalue},
119 }
121res=requests.post(
122self.depositions_base,
123json=data,
124params={"access_token": self.access_token},
125 )
-->126res.raise_for_status()
128res_json=res.json()
129bucket=res_json.get("links", {}).get("bucket")
Filec:\Users\sterg\Miniconda3\envs\matsci-opt-benchmarks\lib\site-packages\requests\models.py:1021, inResponse.raise_for_status(self)
1016http_error_msg= (
1017f"{self.status_code} Server Error: {reason} for url: {self.url}"1018 )
1020ifhttp_error_msg:
->1021raiseHTTPError(http_error_msg, response=self)
HTTPError: 403ClientError: FORBIDDENforurl: https://sandbox.zenodo.org/api/deposit/depositions?access_token=<access_token>
The text was updated successfully, but these errors were encountered:
Hmm, I updated to zenodo-client-0.3.1 and am still getting this issue with sandbox=True. At least in the error message, the access token is the correct one.
It seems to work now. I refreshed my access tokens and restarted the Jupyter notebook kernel. It seems to work for both sandbox and non-sandbox now. Thanks!
For sandbox.zenodo I'm getting:
The text was updated successfully, but these errors were encountered: