src-d / modelforge

Python library to share machine learning models easily and reliably.
Apache License 2.0
18 stars 13 forks source link

Fix typo and init #34

Closed r0mainK closed 6 years ago

r0mainK commented 6 years ago

Just a typo I did not see, there might be a couple of those - btw once everything has been tested for real, i think we should release a new version. However, currently it does not work, because dulwich is bugged:

>>> import dulwich.porcelain as git
>>> git .status()
GitStatus(staged={'add': [], 'delete': [], 'modify': []}, unstaged=[b'README.md', b'bow/1e3da42a-28b6-4b33-94a2-a5671f4102f4.md', b'docfreq/f64bacd4-67fb-4c64-8382-399a8e7db52a.md', b'id-split/3fffe6d4-918f-431e-bccf-f3af388b6ed8.md', b'id2vec/92609e70-f79c-46b5-8419-55726e873cfc.md', b'index.json', b'tensorflow-model/74d255c2-8cf9-4b36-9df4-99c05b981c91.md', b'topics/c70a7514-9257-4b33-b468-27a8588d4dfa.md'], untracked=['.gitignore', 'index.json'])
>>> exit()
:) romain ~/.cache/r0mainK/models (k8s: local-gpu) (git: master) $ git status
On branch master
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    deleted:    README.md
    deleted:    bow/1e3da42a-28b6-4b33-94a2-a5671f4102f4.md
    deleted:    docfreq/f64bacd4-67fb-4c64-8382-399a8e7db52a.md
    deleted:    id-split/3fffe6d4-918f-431e-bccf-f3af388b6ed8.md
    deleted:    id2vec/92609e70-f79c-46b5-8419-55726e873cfc.md
    modified:   index.json
    deleted:    tensorflow-model/74d255c2-8cf9-4b36-9df4-99c05b981c91.md
    deleted:    topics/c70a7514-9257-4b33-b468-27a8588d4dfa.md

no changes added to commit (use "git add" and/or "git commit -a")

I will work on it monday, during OSD.

vmarkovtsev commented 6 years ago

@r0mainK what is the bug exactly? I see no problems in your listing.

r0mainK commented 6 years ago

The typo was: COMMIT_MESSAGES["initilialize"]in the index's reset. Also, the doc in dulwich was bad, it said dulwich' add acted like git add --all when in fact it was just adding untracked files -> so all unstaged files, deleted or modified, were not: nothing happened when doing the reset. Also, the commit would default to CWD, so before it could commit on another repo. I didn't see all this until yesterday, most of the tests I'd done when playing with dulwich were done while it was bugged (actually still is but my PRs should fix it when merged), and without considerations like same/different CWD, untracked/unstaged files, etc. Oh and there was a typo in _are_local_and_remote_heads_different, because I assumed the head method of Repo was a property, which it was not.