Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 06-distributed-computing_jobs_by_key.rst (#259) #346

Open
wants to merge 4 commits into
base: stage
Choose a base branch
from
Open

add 06-distributed-computing_jobs_by_key.rst (#259) #346

wants to merge 4 commits into from

Conversation

ixcat
Copy link
Contributor

@ixcat ixcat commented Jan 23, 2021

fix: #259 , #348

@ixcat
Copy link
Contributor Author

ixcat commented Jan 23, 2021

... am guessing we might want to rework the api similarly to datajoint/datajoint-python#862 - also, this likely implies a new function that saves the truncation step as seen in the docs - thoughts on how to address in matlab? Thinking to just add a new +dj/key_hash.m

Copy link
Collaborator

@guzman-raphael guzman-raphael left a comment

Choose a reason for hiding this comment

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

@ixcat Yes, adding +dj/key_hash.m would be the best means to have equivalent functionality to datajoint/datajoint-python#862. Also, please repoint this to stage so that the tests run properly.

@ixcat ixcat changed the base branch from master to stage February 18, 2021 23:34
@guzman-raphael guzman-raphael linked an issue Mar 24, 2021 that may be closed by this pull request
@@ -12,7 +12,7 @@ function makeTuples(self,key)
r = sprintf('connection_id = %d', c.serverId);

j = fetch(Lab.Jobs() & r, '*');

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like whitespace was added by mistake...

Suggested change

@@ -0,0 +1,37 @@

This can be done by using `dj.internal.hash` to convert the key as follows:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
This can be done by using `dj.internal.hash` to convert the key as follows:
This can be done by using `dj.key_hash` to convert the key as follows:


1 tuples (0.127 s)

> del(Lab.Jobs() & job_key;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
> del(Lab.Jobs() & job_key;
> del(Lab.Jobs() & job_key);

@@ -0,0 +1,7 @@
% dj.key_hash - key hashing function for populate jobs, etc
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since we are adding to the code base, would you add a minimal test for taking the hash to maintain the coverage?

Also, would you remove this and add it properly in the function so that it works with help(...)? See here for an example.

hash = dj.internal.hash(key);
jobKey = struct('table_name', self.className, 'key_hash', hash(1:32));
jobKey = struct('table_name', self.className, ...
'key_hash', key_hash(key));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually, to access it properly you should indicate the package as well:

Suggested change
'key_hash', key_hash(key));
'key_hash', dj.key_hash(key));

@guzman-raphael
Copy link
Collaborator

guzman-raphael commented Mar 26, 2021

@ixcat Oh, missed this before. We should also update docs-parts/intro/Releases_lang1.rst to reflect the new change introduced here. Namely exposing the dj.key_hash utility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add dj.key_hash for working with jobs table matlab-specific documentation for schema.jobs + hash of keys
2 participants