Fix Bug in AO.__init__() When Unit Conversion Import Fails - #81
Merged
Conversation
…class wasn't reported correctly, causing "AttributeError: 'NoneType' object has no attribute 'base_unit'".
Contributor
|
Agreed that this is a pretty obvious typo. I'm going to go ahead and merge it. |
dihm
added a commit
that referenced
this pull request
Dec 7, 2021
commit c054099 Author: David Meyer <dihm@users.noreply.github.com> Date: Tue Dec 7 10:26:22 2021 -0500 Update setup.cfg to show python 3.9 support commit d1ee324 Merge: dbeccbc ce11661 Author: David Meyer <dihm@users.noreply.github.com> Date: Tue Nov 30 12:42:32 2021 -0500 Merge pull request #79 from philipstarkey/break-circular-dependency Updated BLACS to use the new labscript-utils device registry. commit ce11661 Merge: 741d790 dbeccbc Author: David Meyer <dihm@users.noreply.github.com> Date: Tue Nov 30 12:39:25 2021 -0500 Merge branch 'master' into break-circular-dependency commit dbeccbc Merge: 641cdeb 7f9552a Author: David Meyer <dihm@users.noreply.github.com> Date: Wed Nov 24 11:22:29 2021 -0500 Merge pull request #87 from zakv/fix-86 Fixed issue where blacs couldn't close with certain tabs commit 641cdeb Merge: e8bdd1b ff6f447 Author: David Meyer <dihm@users.noreply.github.com> Date: Wed Nov 10 16:57:14 2021 -0500 Merge pull request #81 from zakv/conversion-import-error Fix Bug in AO.__init__() When Unit Conversion Import Fails commit e8bdd1b Merge: b083bb8 868b991 Author: David Meyer <dihm@users.noreply.github.com> Date: Fri Jul 16 16:06:03 2021 -0400 Merge pull request #80 from dihm/blacs-docs Initial pass at BLACS docs commit 868b991 Author: David Meyer <dihm.meyer@gmail.com> Date: Thu Jul 15 10:37:40 2021 -0400 Add docstring coverage check to build. commit ce2c490 Author: David Meyer <dihm.meyer@gmail.com> Date: Thu Jul 15 10:37:15 2021 -0400 Update sphinx pin. commit a3e6040 Author: David Meyer <dihm.meyer@gmail.com> Date: Fri Jul 9 12:05:25 2021 -0400 Add unlisted dependency in `compile_and_restart` on runmanager. commit 2c0ec0c Author: David Meyer <dihm.meyer@gmail.com> Date: Fri Jul 9 11:57:36 2021 -0400 Add missing import to conf.py commit 03a53e2 Author: David Meyer <dihm.meyer@gmail.com> Date: Fri Jul 9 11:55:06 2021 -0400 Add API documentation for the BLACS GUI. commit 869d28f Author: David Meyer <dihm.meyer@gmail.com> Date: Fri Jul 9 11:52:38 2021 -0400 Version bump sphinx to match rest of modules. commit 06539c4 Author: David Meyer <dihm.meyer@gmail.com> Date: Tue Nov 17 19:41:19 2020 -0500 Updating high level docs from @philipstarkey Thesis. commit d542c2f Author: David Meyer <dihm.meyer@gmail.com> Date: Tue Nov 17 17:27:25 2020 -0500 Add API documentation for the blacs submodules. Relies on recursive autosummary and a custom template. In testing builds, noticed that experiment_queue and plugins depended on a properly set up labconfig; namely experiment_shot_storage. Might be an issue on readthedocs. commit 057d849 Author: David Meyer <dihm.meyer@gmail.com> Date: Tue Nov 17 17:03:41 2020 -0500 Add pyqt5 intersphinx inventory. commit b083bb8 Merge: 2bd2aa6 3930ffc Author: chrisjbillington <chrisjbillington@gmail.com> Date: Fri Apr 9 12:27:24 2021 +1000 Merge branch 'dihm/setuptools_scm-fix' commit 3930ffc Author: chrisjbillington <chrisjbillington@gmail.com> Date: Fri Apr 9 12:26:48 2021 +1000 * Continue to set local scheme based on env var in `__version__.py` for consistency. * Don't require specific setuptools or [toml] extra from setuptools_scm. We aren't configuring setuptools_scm in pyproject.toml anyway, and setuptools_scm itself will specify a fairly recent version of setuptools (we have no special requirement ourselves) * no longer use env var for version_scheme in setup.py, since we're now hard-coding release-branch-semver. commit 75b10aa Author: David Meyer <dihm.meyer@gmail.com> Date: Fri Apr 2 13:50:25 2021 -0400 Update setup.cfg Adds setuptools-scm with required version. commit feff404 Author: David Meyer <dihm.meyer@gmail.com> Date: Tue Dec 29 14:22:20 2020 -0500 Update default setuptools_scm version scheme to release-branch-semver. This fixes the circular dependency issue between blacs and labscript-devices. commit 7f9552a Author: Zak V <zakven@mit.edu> Date: Fri Jan 15 08:23:51 2021 -0500 Fixed issue where blacs couldn't close if a tab doesn't have shutdown_workers() and finalise_close_tab() methods. In particular, PluginTab doesn't have these methods. commit 2bd2aa6 Merge: 0e153f2 ca203a4 Author: Chris Billington <chrisjbillington@gmail.com> Date: Tue Jan 5 13:55:02 2021 +1100 Merge pull request #85 from zakv/fix-84 Fix copy/paste bug where stop_order is set to start_order commit ca203a4 Author: Zak V <zakven@mit.edu> Date: Mon Jan 4 21:16:06 2021 -0500 Fixed copy/paste bug where stop_order was set to start_order in QueueManager.manage(). commit ff6f447 Author: Zak V <zakven@mit.edu> Date: Tue Nov 24 17:30:12 2020 -0500 Corrected mistaken change to AO.__init__() error message in previous commit. commit e0a615a Author: Zak V <zakven@mit.edu> Date: Tue Nov 24 16:54:22 2020 -0500 Fixed bug in AO.__init__() where failure to import a unit conversion class wasn't reported correctly, causing "AttributeError: 'NoneType' object has no attribute 'base_unit'". commit 741d790 Author: philipstarkey <philipstarkey@users.noreply.github.com> Date: Thu Jul 16 17:17:02 2020 +1000 Updated BLACS to use the new labscript-utils device registry. Removes the circular dependency on labscript-devices. This update assumes we will publish a new labscript-utils beta (3.1.0b1) shortly (so will fail to build on RTD until that is done)
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.
AO.__init__()is supposed to log an error if it can't import the specified unit conversion class. This is designed to work by settingcls = Noneif the class can't be imported, which should then trigger the'The unit conversion class {cls} could not be imported...'error message to be logged.Previously this failed due to
clsmistakenly being replaced withcalib_class, so theifstatement to generate that error message didn't get triggered. That would cause thecls.base_unit != default_unitsstatement in the laterelifclause to raiseAttributeError: 'NoneType' object has no attribute 'base_unit'.It's clear that this is a simple mixup since the
if calib_class is None:statement occurs inside aif calib_class is not None:block so it could never get triggered. This PR corrects this little mixup.