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

[query] Deprecate default_reference parameter to hl.init #13987

Merged

Conversation

chrisvittal
Copy link
Collaborator

@chrisvittal chrisvittal commented Nov 7, 2023

CHANGELOG: Deprecate default_reference parameter to hl.init, users should use default_reference with an argument to set new default references usually shortly after init.

Resolves #13856

CHANGELOG: Deprecate default_reference parameter to hl.init, users
should use `default_reference` with an argument to set new default
references usually shortly after init.
danking
danking previously requested changes Nov 9, 2023
@@ -141,7 +141,7 @@ def default_reference(self) -> ReferenceGenome:
return self._default_ref

@default_reference.setter
def set_default_reference(self, value):
def default_reference(self, value):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Huh, I would not have expected this to work (two methods with the same name), but indeed it works.

In [1]: class Foo:
   ...:     def __init__(self):
   ...:         self._x = 3
   ...:     @property
   ...:     def x(self):
   ...:         return self._x
   ...:     @x.setter
   ...:     def x(self, new_x):
   ...:         self._x = new_x
   ...: 

In [2]: x = Foo()

In [3]: x.x = 3

In [4]: x.x
Out[4]: 3

In [5]: x.x = 10

In [6]: x.x
Out[6]: 10

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In fact, they have to have the same name. It doesn't work otherwise.

hail/python/hail/context.py Outdated Show resolved Hide resolved
@danking
Copy link
Collaborator

danking commented Nov 9, 2023

Can you also put in a "Fixes #...." line to the description?

Co-authored-by: Dan King <daniel.zidan.king@gmail.com>
@danking danking merged commit c80078b into hail-is:main Nov 27, 2023
8 checks passed
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.

[query] allow setting a non-builtin reference genome as the default
2 participants