Agenda: Python Advanced (2023-10-24 - 2023-10-26)#
Day 1: Basic Python#
Up Front: Project Management#
Exercise Prerequisites#
Datatypes, Datatypes#
Functions#
Looping Constructs (With An Emphasis On The else
Clause)#
Generators#
Miscellaneous#
Day 2: Advanced Python Features#
Closures, Decorators And More#
Dynamic Features#
Object Oriented Programming#
From Object Oriented Programming …
Error Handling And Recovery#
Modules And Packages#
Multithreading#
Discussion: The Global Interpreter Lock (GIL)
Show how the load/modify/store conflict appears to not be an issue in Python (?) (
code/race-load-modify-store.py
)Could that be the GIL ?
What’s the GIL altogether?
Why could it be a bad idea to trust the GIL too much? (⟶ PEP 703)
Jason Brownlee mentions the same “issue” – there is no race condition. There used to, he says, before Python 3.10, but nowadays there’s not. He shows an contrived way to show a race (involving a
time.sleep(0)
🙄)Fix that with a mutex (show
with
usage!)
Multiprocessing#
Simply walk through the introductory example in multiprocessing — Process-based parallelism
Day 3: Into The Wild#
Data Science Topics#
Test Driven Development#
Establish mindset
pytest
fixtures
Group Project: An Idea#
Data acquisition: gathering sensor data
Varying kinds of sensors: physical hardware, internet proxy, MQTT, …
Varying kinds of information sinks: CSV, database, MQTT, …
Acquisition machinery: timestamping, frequency, buffering, …