Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into gh-943
Browse files Browse the repository at this point in the history
* origin/master:
  Removed deprecated parameter
  Depending on bidsschematools
  Removed debug option
  Using upstream schema reference root specification
  Dropped reference log
  Let's see how this goes
  Add test
  get_content_url(): If a HEAD fails, return the failing URL
  Update CHANGELOG.md [skip ci]
  DOC: minor - boost copyright years in the docs
  • Loading branch information
yarikoptic committed Aug 26, 2022
2 parents 744da49 + ef097cc commit 84b6035
Show file tree
Hide file tree
Showing 100 changed files with 52 additions and 18,879 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# 0.46.1 (Thu Aug 18 2022)

#### 🐛 Bug Fix

- Add support for age range [#1101](https://github.com/dandi/dandi-cli/pull/1101) ([@djarecka](https://github.com/djarecka))

#### 📝 Documentation

- DOC: minor - boost copyright years in the docs [#1106](https://github.com/dandi/dandi-cli/pull/1106) ([@yarikoptic](https://github.com/yarikoptic))

#### 🧪 Tests

- Update test.yml to use ubuntu-latest [#1103](https://github.com/dandi/dandi-cli/pull/1103) ([@jwodder](https://github.com/jwodder))

#### Authors: 3

- Dorota Jarecka ([@djarecka](https://github.com/djarecka))
- John T. Wodder II ([@jwodder](https://github.com/jwodder))
- Yaroslav Halchenko ([@yarikoptic](https://github.com/yarikoptic))

---

# 0.46.0 (Thu Aug 18 2022)

#### 🚀 Enhancement
Expand Down
3 changes: 0 additions & 3 deletions dandi/cli/cmd_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@
help="Whether to write a report under a unique path in the DANDI log directory.",
)
@click.argument("paths", nargs=-1, type=click.Path(exists=True, dir_okay=True))
@devel_debug_option()
@map_to_click_exceptions
def validate_bids(
paths,
schema,
report,
report_path,
devel_debug=False,
):
"""Validate BIDS paths.
Expand All @@ -46,7 +44,6 @@ def validate_bids(
report=report,
report_path=report_path,
schema_version=schema,
devel_debug=devel_debug,
)
valid = is_valid(validator_result)
report_errors(validator_result)
Expand Down
2 changes: 1 addition & 1 deletion dandi/cli/tests/test_cmd_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def test_validate_bids_error(bids_examples):
from ..cmd_validate import validate_bids

expected_error = (
"Summary: 2 filename patterns required by BIDS could not be found "
"Summary: 1 filename pattern required by BIDS could not be found "
"and 1 filename did not match any pattern known to BIDS.\n"
)
broken_dataset = os.path.join(bids_examples, "invalid_pet001")
Expand Down
29 changes: 16 additions & 13 deletions dandi/dandiapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1341,19 +1341,22 @@ def get_content_url(
raise NotFoundError(
"No matching URL found in asset's contentUrl metadata field"
)
if follow_redirects is True:
url = self.client.request(
"HEAD", url, json_resp=False, allow_redirects=True
).url
elif follow_redirects:
for _ in range(follow_redirects):
r = self.client.request(
"HEAD", url, json_resp=False, allow_redirects=False
)
if "Location" in r.headers:
url = r.headers["Location"]
else:
break
try:
if follow_redirects is True:
url = self.client.request(
"HEAD", url, json_resp=False, allow_redirects=True
).url
elif follow_redirects:
for _ in range(follow_redirects):
r = self.client.request(
"HEAD", url, json_resp=False, allow_redirects=False
)
if "Location" in r.headers:
url = r.headers["Location"]
else:
break
except requests.HTTPError as e:
url = e.request.url
if strip_query:
url = urlunparse(urlparse(url)._replace(query=""))
return url
Expand Down
Empty file removed dandi/support/bids/__init__.py
Empty file.
153 changes: 0 additions & 153 deletions dandi/support/bids/schema.py

This file was deleted.

Loading

0 comments on commit 84b6035

Please sign in to comment.