Merged
Conversation
Mirrors f9d1d54, which was applied to master; doing changes independently due to major Python API alterations in #1449. - Remove unnecessary comprehensions in dwifslpreproc. - Move all import statements to outer block at top of file. - build: Use sys.exit(); remove unnecessary comprehension. Python signal handler: Do not use sys.exit() (recommended that signal handlers use os._exit() instead). - run_pylint: Prevent error messages in case of empty directories in lib/mrtrix3/.
- build: Convert set to list explicitly where previously there was an unnecesasry comprehension. - Fix module imports in app and run modules.
- Put imports from lib/mrtrix3/__init__.py on their own line separate to the module loads (personal preference). - Move imports to outer scope for many executable scripts. - Fix name clash between input argument to app.cleanup() function and mrtrix3.path module.
Similar to fix made in 8269f6e
- build: Ignore supposed unknown keyword "cwd", which is listed in the online Python documentation for all Python versions. - mrtrix3.app: For mrtrix3 imports, make sure first line is imports from __init__.py and second line is other requisite modules, to see if this fixes an ImportError likely due to circular dependency.
While import of Python modules has been moved to the outer scope, attempting to do so for the import of MRtrix3 Python modules within those modules themselves appears to introduce circular dependencies. This change moves these import statements between MRtrix3 modules into the functions requiring those modules. This should not raise a warning with the latest pylint updates.
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mirrors #1742, but some aspects of solution are different: keeping #1742 to a simple solution in order to fix
master, whereas ondevthe code has instead been more extensively modified to conform to the new formatting recommendations as now imposed bypylint.