-
-
Notifications
You must be signed in to change notification settings - Fork 565
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
Forced installation of matplotlib #259
Comments
I understand. Feel free to submit a PR that makes all troublesome dependencies optional. One option could be to split the cantools package into one core package and one or more smaller for certain tools. But let's try to avoid that. |
This also affects us: we're running cantools on a resource- and bandwidth-constrained platform and would rather remove the install hacks that uninstall matplotlib after installing cantools :) |
I am running
commands like
trying to use As a workaround I reverted to |
I will give it a go, I have more time to work on it right now. |
@AxelVoitier Feel free to review, merge and tag the fix. Tagged commits are automatically published on PyPI, so it should be easy. I'll be less active in the project from now on and I hope everyone interested in cantools will figure out a way for it to continue being successful. |
* p402: Do not switch any states during setup_402_state_machine(). Reading the PDO configuration is possible in OPERATIONAL or PRE-OPERATIONAL states, so switching that is unnecessary. The application should be responsible to handle such transitions, and the library function should be usable without disturbing the application logic. Changing the DS402 state machine to SWITCH ON DISABLED is also not necessary. The drive may be in whatever state from a previous usage, and then the change to SWITCH ON DISABLED may even trigger an exception because there is no way to reach it directly. So this transition should also be the application's responsibility. * p402: Check NMT state before reading PDO configuration. SDOs are allowed in all but the STOPPED state. That would lead to a timeout and an SdoCommunicationError exception. Checking the NMT state here raises an exception without a timeout involved. * p402: Make reading the PDO configuration optional during setup. If the application already configured the PDOs and called .save() on the pdo.Maps object, there is no sense in reading everything back again in the setup_pdos() method. Provide an optional argument to disable that behavior. A call to subscribe to the PDOs from the network is added because that side-effect of pdo.read() is necessary for the TPDO callback to work. * p402: Allow skipping PDO upload from setup_402_state_machine(). Add an optional argument which is simply passed down to setup_pdos() to choose whether reading the PDO configuration is necessary. * Fix DS402 documentation to match the implementation. Besides the changes regarding setup_402_state_machine(), there were numerous errors where the documentation talks about nonexistent or differently named attributes. Also fix the description regaring what the method actually does. It won't configure the TPDO1 to contain the Statusword, but only check the PDO configuration for Statusword and Controlword presence. Co-authored-by: André Filipe Silva <af-silva@users.noreply.github.com>
Hello,
I noticed the new plot feature is creating a hard dependency on matplotlib.
Can this be avoided?
We are installing this package on restricted embedded targets. Just declaring the dependency creates all kind of issues just by installing cantools: from disk usage to compilation time (as it goes through qemu ARM emulation). Especially since matplotlib also depends on numpy...
Can that be declared as an extras in setup.py? And have the main be clever enough to skip on adding subparsers when their importation fails?
Also related is that comment in the main about curses (which actually used to create us issues in the past, as we did not have it on the target :D).
I can send a PR for that later (some times in February, maybe).
Cheers,
Axel
The text was updated successfully, but these errors were encountered: