Last active
March 1, 2022 17:24
-
-
Save devanubis/ec452950c317d3684016dd3b609ebca3 to your computer and use it in GitHub Desktop.
Helics matplotlib conflict
This file contains 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
version: "3" | |
networks: | |
helics: | |
services: | |
federate: | |
build: . | |
depends_on: | |
- "helics" | |
hostname: federate | |
networks: | |
- helics | |
volumes: | |
- .:/app | |
command: | |
python reproduce.py | |
helics: | |
image: helics/helics:latest | |
hostname: helics | |
networks: | |
- helics | |
command: | |
helics_broker --federates=1 --name=test --ipv4 --localport=23456 |
This file contains 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
FROM python:3.10-slim | |
WORKDIR /app | |
RUN pip install -U pip helics matplotlib | |
CMD ["python reproduce.py"] |
This file contains 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
# Importing matplotlib BEFORE helics results in exception | |
import matplotlib | |
import helics | |
import json | |
import socket | |
fed = helics.helicsCreateCombinationFederateFromConfig(json.dumps({ | |
"name": "test_federate", | |
"core_type": "zmq", | |
"federates": 1, | |
"broker_port": 23456, | |
"broker_address": socket.gethostbyname('helics'), | |
})) | |
print("Connected to broker") | |
print(fed) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment