Dear Pioreactor team,
I am using leader only image file with the most recent update on the leader, and I got the following bug:
Running pio --help
in the leader command line results with NameError: name ‘HardwarePWM’ is not defined. The error log for pio --help
:
Traceback (most recent call last):
File "/usr/local/bin/pio", line 8, in <module>
sys.exit(pio())
^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1077, in main
with self.make_context(prog_name, args, **extra) as ctx:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 943, in make_context
self.parse_args(ctx, args)
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1644, in parse_args
rest = super().parse_args(ctx, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1408, in parse_args
value, args = param.handle_parse_result(ctx, opts, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 2400, in handle_parse_result
value = self.process_value(ctx, value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 2362, in process_value
value = self.callback(ctx, self, value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1300, in show_help
echo(ctx.get_help(), color=ctx.color)
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 704, in get_help
return self.command.get_help(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1325, in get_help
self.format_help(ctx, formatter)
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1358, in format_help
self.format_options(ctx, formatter)
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1564, in format_options
self.format_commands(ctx, formatter)
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1617, in format_commands
cmd = self.get_command(ctx, subcommand)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pioreactor/cli/lazy_group.py", line 25, in get_command
return self._lazy_load(cmd_name)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pioreactor/cli/lazy_group.py", line 33, in _lazy_load
mod = importlib.import_module(modname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/local/lib/python3.11/dist-packages/pioreactor/cli/run.py", line 7, in <module>
from pioreactor import actions
File "/usr/local/lib/python3.11/dist-packages/pioreactor/actions/__init__.py", line 6, in <module>
from pioreactor.actions import od_calibration
File "/usr/local/lib/python3.11/dist-packages/pioreactor/actions/od_calibration.py", line 25, in <module>
from pioreactor.background_jobs.od_reading import start_od_reading
File "/usr/local/lib/python3.11/dist-packages/pioreactor/background_jobs/__init__.py", line 6, in <module>
from pioreactor.automations import * # noqa: F401,F403
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pioreactor/automations/__init__.py", line 4, in <module>
from . import dosing
File "/usr/local/lib/python3.11/dist-packages/pioreactor/automations/dosing/__init__.py", line 9, in <module>
from .chemostat import Chemostat
File "/usr/local/lib/python3.11/dist-packages/pioreactor/automations/dosing/chemostat.py", line 5, in <module>
from pioreactor.automations.dosing.base import DosingAutomationJob
File "/usr/local/lib/python3.11/dist-packages/pioreactor/automations/dosing/base.py", line 19, in <module>
from pioreactor.actions.pump import add_alt_media
File "/usr/local/lib/python3.11/dist-packages/pioreactor/actions/pump.py", line 26, in <module>
from pioreactor.utils.pwm import PWM
File "/usr/local/lib/python3.11/dist-packages/pioreactor/utils/pwm.py", line 38, in <module>
class HardwarePWMOutputDevice(HardwarePWM):
^^^^^^^^^^^
In the shared config.ini [PWM] section, I have the same structure as you described in your Cluster topology text. In other words:
[PWM]
# map the PWM channels to externals.
# hardware PWM are available on channels 2 & 4.
1=stirring
2=media
3=alt_media
4=waste
5=heating
However, perhaps the issue is more than that and I could not track it well so I am sharing the issue here. Just to be clear, I do not get this error when I run:
pios --help
in the command line with the leader only imagepio --help
in the command line with the leader-worker image