-
Notifications
You must be signed in to change notification settings - Fork 7
[Draft] added types and docstring to wandb.init #122
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 15f5a8b6-f8e0-4c34-b4f4-a861695a429e
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general this looks awesome, will be awesome to get our official SDK docs in order.
config: Union[Dict, None] = None, # TODO(jhr): type is a union for argparse/absl | ||
project: Optional[str] = None, | ||
entity: Optional[str] = None, | ||
reinit: bool = None, | ||
tags: Optional[List] = None, | ||
team: Optional[str] = None, | ||
team: Optional[str] = None, # LB What is this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it's an alias for entity
. @raubitsj are we using this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ill remove for now, we can add that later
config_exclude_keys=None, | ||
config_include_keys=None, | ||
config_exclude_keys: Optional[str] = None, # LB: Seems unsupported | ||
config_include_keys: Optional[str] = None, # LB: Seems unsupported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@raubitsj what are our plans for hthis?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ill add them, they are trivial to add
settings: Union[Settings, Dict[str, Any], str, None] = None, | ||
) -> Run: | ||
"""Initialize a wandb Run. | ||
disable: bool = None, # LB: What is this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe disable is the same as WANDB_MODE=noop
. It makes all the api calls noop's, this is useful for cases where code is run in a build environment like CI or docker builds.
) -> Run: | ||
"""Initialize a wandb Run. | ||
disable: bool = None, # LB: What is this | ||
offline: bool = None, # LB: What is this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same as WANDB_MODE=dryrun
, it won't connect to a server instead writing experiment data locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to wire that up later this week.
offline is same as WANDB_MODE=dryrun
disable makes all methods noops (no logging locally)
"""Initialize a wandb Run. | ||
disable: bool = None, # LB: What is this | ||
offline: bool = None, # LB: What is this | ||
allow_val_change: bool = None, # LB: What is this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default once a key in wandb.config
is set, we don't allow you to change it. This is to prevent someone overwriting a sweep config value. Setting allow_val_change to True removes this check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am close to getting rid of that, but not ready yet
force: bool = None, | ||
tensorboard: bool = None, # alias for sync_tensorboard, deprecated | ||
sync_tensorboard: bool = None, | ||
monitor_gym: bool = None, # LB: Currently unsupported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jeff added this recently, it's now supported and automatically logs videos generated by openai gym.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
sync_tensorboard: bool = None, | ||
monitor_gym: bool = None, # LB: Currently unsupported | ||
id: Optional[str] = None, | ||
settings: Union[Settings, Dict[str, Any], str, None] = None, # LB: What is this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new wandb.Settings
object that allows configuring all of these settings outside of calls to wandb.init
. See https://github.com/wandb/client-ng/blob/master/wandb/sdk/wandb_settings.py#L193 another great candidate for a better doc string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And on the docs page we really need to ducument classes not just methods
Config,Settings,Run,History,Summary
|
||
Returns: | ||
wandb Run object | ||
|
||
A wandb.run object for metric and config logging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually a wandb.wandb_sdk.wandb_run.ManagedRun
object. We might want to expose this in the global namespace as Run
so users could do help wandb.Run
. Another gotcha is that sometimes this is a DummyRun if we're in noop mode. @raubitsj thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ManagedRun and DummyRun will be unified as Run... coming soon
@lukas , thanks for the detailed look at supported features. We are doing the final push now to implement everything that is part of our function calls so I will give you the signal in a day or two: ~august 12th maybe when everything is ready. |
@lukas The code is much closer, I have removed remnants of any new parameters that were not supported: Things still not fully implemented: New settings: |
Jeff - could you make sure you are happy this and I will try to add this kind of types and docstrings to all the external functions?