Comments (3)
We don't generally avoid all traitsui
imports in such cases. This is why traitsui
has the null
backend and is generally careful to avoid actual toolkit imports until someone actually calls .edit_traits()
.
from scimath.
Thanks @rkern! I will admit to being a little confused here... we recently had a discussion on that consulting project about the value of structuring code to avoid TraitsUI imports for non-GUI things. It looks like, since the model objects use UnitScalar, TraitsUI is unavoidable?
In any case, it looks like the comment in the above file is wrong, as it suggests the import is delayed specifically to avoid loading UI code (which may have been the motivation, but it's not what happens).
from scimath.
I failed to give the fully-nuanced general rules for simplicity's sake (the specific actions you had proposed were perfectly reasonable, so I didn't want to sidetrack). :-) My apologies.
Indeed the comment is bogus. This trait ought to be rewritten as a TraitType
with the editor import placed inside of a get_editor()
method. This trait predates TraitType
, I think.
from scimath.
Related Issues (20)
- Remove "scimath.units.unit_converter.convert_quantity_old" HOT 1
- Improve module docstrings in "scimath.units" HOT 1
- Address deprecation warnings raised in the testsuite HOT 1
- Warnings when compiling "scimath.interpolate._interpolate" HOT 2
- Have unit names with `ยต` for micro- prefix and allow other symbolic unit names
- Can "scimath.units.unit_array.__newobj__" be removed? HOT 2
- Remove `*`-imports or use `__all__`
- Use "observe" instead of "on_trait_change" HOT 1
- [5.0.0] Release Checklist
- Update "setup.py" to ship release candidates
- Test fail with Python 3.8
- Update copyright header dates
- Investigate compatibility with Python 3.11 HOT 13
- Update documentation of scimath to include test environment setup HOT 4
- Add new SI prefixes HOT 1
- When we test pypi with python 3.6 and ubuntu 22.04, a architecture not found error will happen HOT 2
- Tracebacks in test output HOT 5
- Github actions: add doc generation workflow HOT 1
- Error during installation HOT 2
- Bleeding edge workflow reinstalls packages into the bootstrap edm environment, not the dev environment
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scimath.