Skip to content

Commit

Permalink
Make _VariableManager.get_key private
Browse files Browse the repository at this point in the history
  • Loading branch information
himkt committed Nov 24, 2021
1 parent 038a75a commit 69cc663
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions optuna/integration/allennlp/_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, target_pid: int) -> None:
def prefix(self) -> str:
return "{}_OPTUNA_ALLENNLP".format(self.target_pid)

def get_key(self, name: str) -> Optional[str]:
def _get_key(self, name: str) -> Optional[str]:
return self.NAME_OF_KEY.get(name)

def set_value(self, name: str, value: str) -> None:
Expand All @@ -53,7 +53,7 @@ def set_value(self, name: str, value: str) -> None:
`set_value` is only invoked in `optuna.integration.allennlp.AllenNLPExecutor`.

"""
key = self.get_key(name)
key = self._get_key(name)
name_of_path = "optuna.integration.allennlp._variables._VariableManager.NAME_OF_KEY"
assert key is not None, f"{name} is not found in `{name_of_path}`."

Expand All @@ -66,7 +66,7 @@ def get_value(self, name: str) -> Optional[str]:
`get_value` is only called in `optuna.integration.allennlp.AllenNLPPruningCallback`.

"""
key = self.get_key(name)
key = self._get_key(name)
name_of_path = "optuna.integration.allennlp._variables._VariableManager.NAME_OF_KEY"
assert key is not None, f"{name} is not found in `{name_of_path}`."

Expand Down

0 comments on commit 69cc663

Please sign in to comment.