resources

How can I have parallel Snakemake jobs fit in limited memory?

How can I have parallel Snakemake jobs fit in limited memory? Question: The Snakemake‘s scheduler ignores my mem_mb declaration and executes in parallel jobs which summed requirements exceed the available memory (e.g. three jobs with mem_mb=53000 in a 128 GB system). Moreover, it runs even jobs which declared requirements (over 1TB when I run snakemake …

Total answers: 2

How can resources be provided in PyQt6 (which has no pyrcc)?

How can resources be provided in PyQt6 (which has no pyrcc)? Question: The documentation for PyQt6 states that Support for Qt’s resource system has been removed (i.e. there is no pyrcc6). In light of this, how should one provide resources for a PyQt6 application? Asked By: biqqles || Source Answers: There has been some discussion …

Total answers: 6

How to idiomatically open multiple managed resources from an object method in Python

How to idiomatically open multiple managed resources from an object method in Python Question: What is the most Pythonic way of constructing an object to open multiple (context managed) resources and do work with those resources? I have a class which opens several managed resources, which are then operated on in class methods. For example, …

Total answers: 1

How to load image resources with PyQt?

How to load image resources with PyQt? Question: I have this estructure on my application: |-App | |-functions | |-ui |–ui.py | |images | |main.py i have a functions folder with some scripts and a ui folder with the PyQt generated code on the ui.py file. and a main.py file that loads the ui.py to …

Total answers: 1

Python: ulimit and nice for subprocess.call / subprocess.Popen?

Python: ulimit and nice for subprocess.call / subprocess.Popen? Question: I need to limit the amount of time and cpu taken by external command line apps I spawn from a python process using subprocess.call , mainly because sometimes the spawned process gets stuck and pins the cpu at 99%. nice and ulimit seem like reasonable ways …

Total answers: 3

Managing resources in a Python project

Managing resources in a Python project Question: I have a Python project in which I am using many non-code files. Currently these are all images, but I might use other kinds of files in the future. What would be a good scheme for storing and referencing these files? I considered just making a folder “resources” …

Total answers: 4

Is it safe to yield from within a "with" block in Python (and why)?

Is it safe to yield from within a "with" block in Python (and why)? Question: The combination of coroutines and resource acquisition seems like it could have some unintended (or unintuitive) consequences. The basic question is whether or not something like this works: def coroutine(): with open(path, ‘r’) as fh: for line in fh: yield …

Total answers: 5