Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jiakunf
Copy link
Contributor

@jiakunf jiakunf commented Dec 8, 2016

Add getLocalPath in python

.gitignore Outdated
.DS_Store
.idea
*__pycache__*
*.edd-info*
Copy link
Member

Choose a reason for hiding this comment

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

Looks like .egg-info was misspelled - would you mind removing this entry?

class Paths(dj.Lookup):
definition = ...

def getLocalPath(self, path, local_os=None):
Copy link
Member

Choose a reason for hiding this comment

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

Keeping with Python convention, let's call this get_local_path, using snake_case rather thank CamelCase. Although this makes the method name different from Matlab, it fits better with rest of the naming conventions.

class Paths(dj.Lookup):
definition = ...

def getLocalPath(self, path, local_os=None):
Copy link
Member

Choose a reason for hiding this comment

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

Also this method doesn't use self, which usually suggests that this is better off as a staticmethod. Place @staticmethod right above the function definition, and you can skip the self argument.

Copy link
Member

Choose a reason for hiding this comment

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

Complete oversight on my side - it does indeed use self as this is acting as placeholder class for DataJoint table implemented in Matlab.

@eywalker eywalker changed the title Update Implement getLocalPath in Python Dec 9, 2016
@eywalker eywalker merged commit 165897f into atlab:master Dec 9, 2016
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.

2 participants