Closed atrisovic closed 1 year ago
The same error happens in this example:
dataset = Dataset.from_dataverse_doi(
doi="doi:10.7910/DVN/SYNPBS",
dataverse_url="https://dataverse.harvard.edu"
)
Also in the command line:
(easyDVconda) ant746@MacBook:~/PycharmProjects/easyDataverse/temp (main) $ dataverse fetch https://demo.dataverse.org/dataset.xhtml?persistentId=doi:10.70122/FK2/Y73N6C
/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/core/dataset.py:469: UserWarning: No 'API_TOKEN' found in the environment. Please be aware, that you might not have the rights to download this dataset.
warnings.warn(
Traceback (most recent call last):
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/bin/dataverse", line 8, in <module>
sys.exit(main())
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/cli.py", line 94, in main
app()
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/cli.py", line 86, in fetch
dataset = Dataset.from_url(url, path)
File "pydantic/decorator.py", line 40, in pydantic.decorator.validate_arguments.validate.wrapper_function
File "pydantic/decorator.py", line 134, in pydantic.decorator.ValidatedFunction.call
File "pydantic/decorator.py", line 201, in pydantic.decorator.ValidatedFunction.execute
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/core/dataset.py", line 359, in from_url
return cls.from_dataverse_doi(
File "pydantic/decorator.py", line 40, in pydantic.decorator.validate_arguments.validate.wrapper_function
File "pydantic/decorator.py", line 134, in pydantic.decorator.ValidatedFunction.call
File "pydantic/decorator.py", line 201, in pydantic.decorator.ValidatedFunction.execute
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/core/dataset.py", line 416, in from_dataverse_doi
return cls._fetch_without_lib(
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/core/dataset.py", line 473, in _fetch_without_lib
return download_from_dataverse_without_lib(**kwargs)
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/tools/downloader/downloader.py", line 99, in download_from_dataverse_without_lib
blocks = [
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/tools/downloader/downloader.py", line 100, in <listcomp>
create_block_definitions(block_name, block, dataverse_url)
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/tools/downloader/nolibutils.py", line 95, in create_block_definitions
_process_field(field, lookup, cls_def, add_funs)
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/tools/downloader/nolibutils.py", line 138, in _process_field
fun(field, lookup, cls_def, add_funs)
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/tools/downloader/nolibutils.py", line 162, in _process_compound
add_funs[f"add_{field_name}"] = _generate_add_method(cls, field_name)
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/tools/downloader/nolibutils.py", line 245, in _generate_add_method
return forge.sign(
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/forge/_revision.py", line 331, in __call__
inner.__mapper__ = Mapper(next_, callable) # type: ignore
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/forge/_revision.py", line 62, in __init__
public_signature = fsignature.native
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/forge/_signature.py", line 1231, in native
[param.native for param in self if not param.bound],
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/forge/_signature.py", line 1231, in <listcomp>
[param.native for param in self if not param.bound],
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/forge/_signature.py", line 355, in native
return inspect.Parameter(
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/inspect.py", line 2673, in __init__
raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'e-mail' is not a valid parameter name
(easyDVconda) ant746@MacBook:~/PycharmProjects/easyDataverse/temp (main) $ export API_TOKEN=SoMeToKeN
(easyDVconda) ant746@MacBook:~/PycharmProjects/easyDataverse/temp (main) $
(easyDVconda) ant746@MacBook:~/PycharmProjects/easyDataverse/temp (main) $ dataverse fetch https://demo.dataverse.org/dataset.xhtml?persistentId=doi:10.70122/FK2/Y73N6C
/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/core/dataset.py:469: UserWarning: No 'API_TOKEN' found in the environment. Please be aware, that you might not have the rights to download this dataset.
warnings.warn(
Traceback (most recent call last):
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/bin/dataverse", line 8, in <module>
sys.exit(main())
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/cli.py", line 94, in main
app()
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/cli.py", line 86, in fetch
dataset = Dataset.from_url(url, path)
File "pydantic/decorator.py", line 40, in pydantic.decorator.validate_arguments.validate.wrapper_function
File "pydantic/decorator.py", line 134, in pydantic.decorator.ValidatedFunction.call
File "pydantic/decorator.py", line 201, in pydantic.decorator.ValidatedFunction.execute
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/core/dataset.py", line 359, in from_url
return cls.from_dataverse_doi(
File "pydantic/decorator.py", line 40, in pydantic.decorator.validate_arguments.validate.wrapper_function
File "pydantic/decorator.py", line 134, in pydantic.decorator.ValidatedFunction.call
File "pydantic/decorator.py", line 201, in pydantic.decorator.ValidatedFunction.execute
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/core/dataset.py", line 416, in from_dataverse_doi
return cls._fetch_without_lib(
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/core/dataset.py", line 473, in _fetch_without_lib
return download_from_dataverse_without_lib(**kwargs)
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/tools/downloader/downloader.py", line 99, in download_from_dataverse_without_lib
blocks = [
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/tools/downloader/downloader.py", line 100, in <listcomp>
create_block_definitions(block_name, block, dataverse_url)
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/tools/downloader/nolibutils.py", line 95, in create_block_definitions
_process_field(field, lookup, cls_def, add_funs)
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/tools/downloader/nolibutils.py", line 138, in _process_field
fun(field, lookup, cls_def, add_funs)
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/tools/downloader/nolibutils.py", line 162, in _process_compound
add_funs[f"add_{field_name}"] = _generate_add_method(cls, field_name)
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/easyDataverse/tools/downloader/nolibutils.py", line 245, in _generate_add_method
return forge.sign(
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/forge/_revision.py", line 331, in __call__
inner.__mapper__ = Mapper(next_, callable) # type: ignore
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/forge/_revision.py", line 62, in __init__
public_signature = fsignature.native
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/forge/_signature.py", line 1231, in native
[param.native for param in self if not param.bound],
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/forge/_signature.py", line 1231, in <listcomp>
[param.native for param in self if not param.bound],
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/site-packages/forge/_signature.py", line 355, in native
return inspect.Parameter(
File "/Users/ant746/opt/miniconda3/envs/easyDVconda/lib/python3.10/inspect.py", line 2673, in __init__
raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'e-mail' is not a valid parameter name
I use Python 3.10
I get the same error when I install easyDataverse from source and when I install it with pip
Thanks for the issue! I proposed a pull request #7 to address this bug and tested your code. It works on my side now except I have no authorization to fetch the dataset. Could you try to fetch it using the PR branch?
Hey!
I successfully install easyDataverse, but get an error when creating a dataset. This is my code:
This is the error:
What am I doing wrong? x-)