Skip to content

Definitely way too large and comprehensive python project for the electronic physics lab, that will most likely not get finished.

Notifications You must be signed in to change notification settings

Mag559/physics-macros

Repository files navigation

Physics report helper project

Definitely way too large and comprehensive python project for the electronic physics lab, that will most likely not get finished.

There is no gui or tui, feel free to make one tho ;). Intended usage involves either importing desired functions from mentioned files and running them with readings as parameters in main.py or writing them in the if __name__ == '__main__': statement (to avoid executing that code if that file is imported)

Important note

Measure functions return UncertainQuantity objects. By default, they have a border error associated with them. To change the border error to a standard error call to_standard_error. Calling it multiple times doesn't compromise the object.

Any functions working on UncertainQuantities to compute another measurement with a composite error are required to convert to standard error (so the user doesn't have to).

Includes

Rounding macro

See file macros_frontend/rounding_macro.py which replaces "." with "," as well as rounding the value and its error

Clipboard macro

See file macros_frontend/clipboard_macro.py, which allows your clipboard to function like a LIFO stack. Copy multiple pieces of text and paste all of them back in reverse order.

Errors for measurements conducted on SDS1052DL oscilloscope

See file devices_border_errors/oscilloscope.py

Errors for measurements conducted on metex3800 multimeter

See file devices_border_errors/metex.py

How does this work?

Macros

See file macros_backend/backend_classes.py.

They rely on the pynput library, which allows you to control the keyboard and mouse through code alongside listening for such events.

The gist is that InputCollector class listens what kind of keyboard events are happening, if it detects one listed in the ImportantEvents enum, it emits an event of its own.

Then the specific class of the macro, see macros_frontend.py, receives the event and does sth in response. That response could be pressing some keys e.g. ctrl + v, in that case class InputPresser should be used if the response action doesn't overlap with the stimulus actions. Otherwise (if the class can be summarized as "on ctrl + v pressed, do sth, press ctrl + v") use the SelfIgnoringInputCollector with the threading library. It filters out the events created by itself.

Calculations on values with uncertainties

About

Definitely way too large and comprehensive python project for the electronic physics lab, that will most likely not get finished.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages