Skip to content

Commit

Permalink
update DOI
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasprobst committed Mar 14, 2024
1 parent 04d6a4d commit 6dd3d3e
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion docs/colab/quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"- Define important attributes and their usage in a metadata convention (e.g. a YAML file)\n",
"- Publish your convention on a repository like [Zenodo](https://zenodo.org/)\n",
"\n",
"At this time we assume, that we have done this already, thus we'll be using a convention published on [Zenodo (doi/rec-id: 10156750)](https://zenodo.org/records/10156750), that already exists:"
"At this time we assume, that we have done this already, thus we'll be using a convention published on [Zenodo (doi/rec-id: 10428822)](https://zenodo.org/records/10428822), that already exists:"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/gettingstarted/quickoverview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
}
],
"source": [
"cv = h5tbx.convention.from_zenodo('10156750')\n",
"cv = h5tbx.convention.from_zenodo('10428822')\n",
"cv"
]
},
Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/convention/creating_a_new_convention.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@
}
],
"source": [
"cv = h5tbx.convention.from_zenodo(doi_or_recid='10156750')\n",
"cv = h5tbx.convention.from_zenodo(doi_or_recid='10428822')\n",
"cv"
]
},
Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/convention/examples/Provenance.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
}
],
"source": [
"cv = h5tbx.convention.from_zenodo('https://zenodo.org/records/10156750')\n",
"cv = h5tbx.convention.from_zenodo('https://zenodo.org/records/10428822')\n",
"\n",
"h5tbx.use(cv)"
]
Expand Down
4 changes: 2 additions & 2 deletions h5rdmtoolbox/convention/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,8 @@ def from_zenodo(doi_or_recid: str,
Parameters
----------
doi_or_recid: str
DOI of the zenodo repository. Can be a short DOI or a full DOI or the URL (e.g. 10156750 or
10.5281/zenodo.10156750 or https://doi.org/10.5281/zenodo.10156750 or only the record id, e.g. 10156750)
DOI of the zenodo repository. Can be a short DOI or a full DOI or the URL (e.g. 10428822 or
10.5281/zenodo.10428822 or https://doi.org/10.5281/zenodo.10428822 or only the record id, e.g. 10428822)
name: str=None
Name to be sed for the filename. If None, the name is taken from the zenodo record.
overwrite: bool = False
Expand Down
2 changes: 1 addition & 1 deletion h5rdmtoolbox/repository/zenodo/tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_api_token(sandbox: bool,

logger.debug('No environment variable found for the zenodo token. Trying to read it from the config file '
'%s .' % zenodo_ini_filename)

print(env_token)
zenodo_ini_filename = _parse_ini_file(zenodo_ini_filename)
config = configparser.ConfigParser()
config.read(zenodo_ini_filename)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
class TestStandardAttributes(unittest.TestCase):

def setUp(self) -> None:
# cv = h5tbx.convention.from_zenodo(doi_or_recid=10156750, overwrite=True)
repo = zenodo.ZenodoRecord(10156750)
# cv = h5tbx.convention.from_zenodo(doi_or_recid=10428822, overwrite=True)
repo = zenodo.ZenodoRecord(10428822)
cv = h5tbx.convention.from_repo(repo,
name='tutorial_convention.yaml',
take_existing=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ def setUp(self) -> None:

h5tbx.use(None)

# cv = h5tbx.convention.from_zenodo('https://zenodo.org/record/10156750',
# cv = h5tbx.convention.from_zenodo('https://zenodo.org/record/10428822',
# overwrite=True,
# force_download=True)
from h5rdmtoolbox.repository.zenodo import ZenodoRecord
repo = ZenodoRecord(10156750)
repo = ZenodoRecord(10428822)
cv = h5tbx.convention.from_repo(repo,
name='tutorial_convention.yaml',
take_existing=True,
force_download=True)
# cv = h5tbx.convention.from_zenodo('https://zenodo.org/record/10156750',
# cv = h5tbx.convention.from_zenodo('https://zenodo.org/record/10428822',
# overwrite=True,
# force_download=True)

Expand Down
6 changes: 3 additions & 3 deletions tests/conventions/test_conventions.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def test_overload_standard_attributes(self):
def test_overwrite_existing_file(self):
if self.connected:
# delete an existing convention like this first:
h5tbx.convention.from_zenodo(doi_or_recid='10156750', overwrite=False)
h5tbx.convention.from_zenodo(doi_or_recid='10428822', overwrite=False)
# h5tbx.convention.from_yaml('test_convention.yaml')
h5tbx.use('h5rdmtoolbox-tutorial-convention')

Expand Down Expand Up @@ -545,8 +545,8 @@ def test_from_zenodo(self):

# we can download from zenodo by passing the short or full DOI or the URL:

dois = ('10156750', '10.5281/zenodo.10156750', 'https://zenodo.org/record/10156750',
'https://doi.org/10.5281/zenodo.10156750')
dois = ('10428822', '10.5281/zenodo.10428822', 'https://zenodo.org/record/10428822',
'https://doi.org/10.5281/zenodo.10428822')
h5tbx.UserDir.clear_cache()
with self.assertRaises(ValueError): # because it is not a standard attribute YAML file!
cv = h5tbx.convention.from_zenodo(doi=10428795)
Expand Down
10 changes: 5 additions & 5 deletions tests/test_repr.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ def test_process_string_for_link(self):
self.assertFalse(has_url)
self.assertEqual(processed_string, string_without_url)

zenodo_url = 'https://zenodo.org/record/10156750'
img_url = f'https://zenodo.org/badge/DOI/10.5281/zenodo.10156750.svg'
zenodo_url = 'https://zenodo.org/record/10428822'
img_url = f'https://zenodo.org/badge/DOI/10.5281/zenodo.10428822.svg'
self.assertEqual(f'<a href="{zenodo_url}"><img src="{img_url}" alt="DOI"></a>',
process_string_for_link(zenodo_url)[0])

zenodo_url = 'https://doi.org/10.5281/zenodo.10156750'
img_url = f'https://zenodo.org/badge/DOI/10.5281/zenodo.10156750.svg'
zenodo_url = 'https://doi.org/10.5281/zenodo.10428822'
img_url = f'https://zenodo.org/badge/DOI/10.5281/zenodo.10428822.svg'
self.assertEqual(f'<a href="{zenodo_url}"><img src="{img_url}" alt="DOI"></a>',
process_string_for_link('10.5281/zenodo.10156750')[0])
process_string_for_link('10.5281/zenodo.10428822')[0])

string_with_url = "This is a string with a web URL: https://www.example.com which goes on and on and on"
string_with_href = 'This is a string with a web URL: ' \
Expand Down

0 comments on commit 6dd3d3e

Please sign in to comment.