Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix some bugs found via 1.8.6-dev smoke tests #2011

Merged
merged 10 commits into from
Nov 2, 2023

Conversation

shnizzedy
Copy link
Member

@shnizzedy shnizzedy commented Oct 28, 2023

Fixes

Technical details

string indices must be integers

Dashes Underscores and spaces in the regressor names were causing problems in the regressors downstream from forked filters, so I updated the regressor naming to only include alphanumeric characters and no-more-than-one-in-a-row underscores, which renamed some regressors in some preconfigs to names including underscores, which doesn't play well with

regressor_strat_name = regressor_prov[-1].split('_')[-1]
for regressor_dct in cfg['nuisance_corrections']['2-nuisance_regression'][
'Regressors']:
if regressor_dct['Name'] == regressor_strat_name:
opt = regressor_dct
, so I abstracted this lookup into a strat_pool (ResourcePool) method that tries names with zero underscores up through as many as are in the prov in
strat_name_components = prov[-1].split('_')
for _ in list(range(prov[-1].count('_'))):
reg_name = '_'.join(strat_name_components[-_:])
if reg_name in self.regressors:
self._regressor_dct = self.regressors[reg_name]
return self._regressor_dct
raise key_error
opt = strat_pool.regressor_dct(cfg)

cannot unpack non-iterable NoneType object

I overtrimmed in 6ca33b9, repaired the damage with

if optional:
if report_fetched:
return (None, None)
return None
raise LookupError(info_msg)

These tests will still be failing after these changes, but they should be more-helpful missing-resource exceptions

Where it seems to try to look up the error message itself in a list?

This one was some exception handling that needed updated. The lookup was from trying to parse the key out of the error to see if we should

raise FileNotFoundError(
'The provided pipeline configuration requires functional '
'data but no functional data were found for ' +
'/'.join([sub_dict[key] for key in ['site', 'subject_id',
'unique_id'] if key in sub_dict]) + '. Please check '
'your data and pipeline configurations.') from lookup_error
instead of a less-informative-to-an-end-user error. This PR beefs up the key searching and should gracefully just fall back to the original exception if it fails to find the key in the exception message.

Tests

Manually launched smoke tests

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the develop branch of the repository.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I updated the changelog.
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

- handle regressor names with underscores when matching strategy provenance
- restore some over-trimmed DRYing in ResourcePool.get
- expand key-finding in exception handling in build_workflow
@shnizzedy shnizzedy temporarily deployed to ACCESS October 28, 2023 04:11 — with GitHub Actions Inactive
@shnizzedy shnizzedy temporarily deployed to ACCESS October 28, 2023 04:11 — with GitHub Actions Inactive
@shnizzedy shnizzedy mentioned this pull request Oct 28, 2023
8 tasks
@shnizzedy shnizzedy mentioned this pull request Oct 30, 2023
8 tasks
@e-kenneally e-kenneally marked this pull request as ready for review November 1, 2023 20:44
@sgiavasis sgiavasis merged commit ecfc583 into develop Nov 2, 2023
2 checks passed
@shnizzedy shnizzedy deleted the fix/smoke-1.8.6-dev branch November 6, 2023 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants