-
Notifications
You must be signed in to change notification settings - Fork 29
Added repos, packages and python version store function. #285
Conversation
qtt/tools.py
Outdated
@@ -13,7 +13,9 @@ | |||
from itertools import chain | |||
import scipy.ndimage as ndimage | |||
from functools import wraps | |||
|
|||
from pip import get_installed_distributions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a general rule (maybe also good for the demonstrator): first python default packages, then pip packages, then local packages. So dulwich
should be imported after glob
, time
, etc.
qtt/tools.py
Outdated
return {'python' : version} | ||
|
||
def get_code_versions(repos, verbose=0): | ||
''' Returns the repository head guid and dirty status and package version number if installed via pip. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use """
instead of '''
, see https://www.python.org/dev/peps/pep-0257/#id15
qtt/tools.py
Outdated
python = get_python_version(verbose) | ||
modules = get_module_versions(['numpy', 'scipy', 'qctoolkit'], verbose) | ||
gits = get_code_versions(['qcodes', 'qtt', 'spin-projects', 'pycqed'], verbose) | ||
return {**python, **modules, **gits} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also include a timestamp here, that might be valuable as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks structured enough as works, but we need a lightweight version as well. The current get_versions
takes over 1 second to execute. A get_module_versions(['numpy', 'scipy', 'qctoolkit'], verbose)
takes about 30 ms (bottleneck is get_distibutions
which in itself takes 30 ms).
The original code_versions
took only 3 ms.
Having the full version available is fine, but we need something that we can can after each measurement.
Can you modify the code so we have a lightweight version for each measurement and a full version for completeness.
@lucblom |
@peendebak updated with timestamp and style changes. Will check on qubyte machine, probably requires VS build tools for compiling. |
@lucblom On the qubyte machine the VS build tools are already installed (did this last week). Installing this on all measurement setups will create too much trouble. There is a pure python option too Can you test the speed of the python only implementation? If it is fast enough, we can use update the installation instructions to use that. |
Speed tests of Qubyte:
My Laptop:
|
3e3053d
to
6419776
Compare
@lucblom Did a rebase to master |
…hanged get_version returned results.
Ready to merge @peendebak? |
@peendebak
Created the get_versions function for collecting the code properties of a setup. Unfortunately the unstaged files are not returned correctly by dilwich, see here: jelmer/dulwich#598. This bug prevents us currently from collecting the dirty status of a repository.