Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Added repos, packages and python version store function. #285

Merged
merged 8 commits into from
Apr 16, 2018

Conversation

CumulonimbusCalvus
Copy link
Contributor

@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.

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
Copy link
Contributor

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}
Copy link
Contributor

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.

Copy link
Contributor

@peendebak peendebak left a 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.

@peendebak
Copy link
Contributor

@lucblom dulwich needs to compile some stuff to install. On the qubyte machine there is no compiler, so pip install dulwich fails. We needs something to fix that

@CumulonimbusCalvus
Copy link
Contributor Author

@peendebak updated with timestamp and style changes. Will check on qubyte machine, probably requires VS build tools for compiling.

@peendebak
Copy link
Contributor

@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 pip install dulwich --global-option="--pure", see the installation instructions on https://github.com/dulwich/dulwich

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.

@CumulonimbusCalvus
Copy link
Contributor Author

CumulonimbusCalvus commented Apr 12, 2018

Speed tests of qtt.tools.get_versions() with pure installation:

Qubyte:

  • First time: 5.9739 ms
  • After first time: 2.0782 ms

My Laptop:

  • First time: 0.584 s
  • After first time: 10.5057 ms

@peendebak
Copy link
Contributor

@lucblom Did a rebase to master

@CumulonimbusCalvus
Copy link
Contributor Author

Ready to merge @peendebak?

@peendebak
Copy link
Contributor

@lucblom Yes, let's merge. Can you also take a look at #290?

@peendebak peendebak merged commit 1dc3c07 into master Apr 16, 2018
@peendebak peendebak deleted the feat/code_version branch April 30, 2018 20:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants