id int64 1 6.07M | name stringlengths 1 295 | code stringlengths 12 426k | language stringclasses 1
value | source_file stringlengths 5 202 | start_line int64 1 158k | end_line int64 1 158k | repo dict |
|---|---|---|---|---|---|---|---|
1,701 | files | def files(self, names=None, per_page=50):
"""Iterate over all files stored in this artifact.
Arguments:
names: (list of str, optional) The filename paths relative to the
root of the artifact you wish to list.
per_page: (int, default 50) The number of files to return per request
Returns:
(`ArtifactFiles`): An iterator containing `File` objects
"""
return ArtifactFiles(self.client, self, names, per_page) | python | wandb/apis/public.py | 5,089 | 5,100 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,702 | _load_manifest | def _load_manifest(self):
if self._manifest is None:
query = gql(
"""
query ArtifactManifest(
$entityName: String!,
$projectName: String!,
$name: String!
) {
project(name: $projectName, entityName: $entityName) {
artifact(name: $name) {
currentManifest {
id
file {
id
directUrl
}
}
}
}
}
"""
)
response = self.client.execute(
query,
variable_values={
"entityName": self.entity,
"projectName": self.project,
"name": self._artifact_name,
},
)
index_file_url = response["project"]["artifact"]["currentManifest"]["file"][
"directUrl"
]
with requests.get(index_file_url) as req:
req.raise_for_status()
self._manifest = artifacts.ArtifactManifest.from_manifest_json(
json.loads(util.ensure_text(req.content))
)
self._load_dependent_manifests()
return self._manifest | python | wandb/apis/public.py | 5,102 | 5,145 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,703 | _load_dependent_manifests | def _load_dependent_manifests(self):
"""Interrogate entries and ensure we have loaded their manifests."""
# Make sure dependencies are avail
for entry_key in self._manifest.entries:
entry = self._manifest.entries[entry_key]
if self._manifest_entry_is_artifact_reference(entry):
dep_artifact = self._get_ref_artifact_from_entry(entry)
if dep_artifact not in self._dependent_artifacts:
dep_artifact._load_manifest()
self._dependent_artifacts.append(dep_artifact) | python | wandb/apis/public.py | 5,147 | 5,156 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,704 | _manifest_entry_is_artifact_reference | def _manifest_entry_is_artifact_reference(entry):
"""Determine if an ArtifactManifestEntry is an artifact reference."""
return (
entry.ref is not None
and urllib.parse.urlparse(entry.ref).scheme == "wandb-artifact"
) | python | wandb/apis/public.py | 5,159 | 5,164 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,705 | _get_ref_artifact_from_entry | def _get_ref_artifact_from_entry(self, entry):
"""Helper function returns the referenced artifact from an entry."""
artifact_id = util.host_from_path(entry.ref)
return Artifact.from_id(hex_to_b64_id(artifact_id), self.client) | python | wandb/apis/public.py | 5,166 | 5,169 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,706 | used_by | def used_by(self):
"""Retrieve the runs which use this artifact directly.
Returns:
[Run]: a list of Run objects which use this artifact
"""
query = gql(
"""
query ArtifactUsedBy(
$id: ID!,
$before: String,
$after: String,
$first: Int,
$last: Int
) {
artifact(id: $id) {
usedBy(before: $before, after: $after, first: $first, last: $last) {
edges {
node {
name
project {
name
entityName
}
}
}
}
}
}
"""
)
response = self.client.execute(
query,
variable_values={"id": self.id},
)
# yes, "name" is actually id
runs = [
Run(
self.client,
edge["node"]["project"]["entityName"],
edge["node"]["project"]["name"],
edge["node"]["name"],
)
for edge in response.get("artifact", {}).get("usedBy", {}).get("edges", [])
]
return runs | python | wandb/apis/public.py | 5,171 | 5,216 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,707 | logged_by | def logged_by(self):
"""Retrieve the run which logged this artifact.
Returns:
Run: Run object which logged this artifact
"""
query = gql(
"""
query ArtifactCreatedBy(
$id: ID!
) {
artifact(id: $id) {
createdBy {
... on Run {
name
project {
name
entityName
}
}
}
}
}
"""
)
response = self.client.execute(
query,
variable_values={"id": self.id},
)
run_obj = response.get("artifact", {}).get("createdBy", {})
if run_obj is not None:
return Run(
self.client,
run_obj["project"]["entityName"],
run_obj["project"]["name"],
run_obj["name"],
) | python | wandb/apis/public.py | 5,218 | 5,254 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,708 | __init__ | def __init__(
self,
client: Client,
entity: str,
project: str,
collection_name: str,
type: str,
filters: Optional[Mapping[str, Any]] = None,
order: Optional[str] = None,
per_page: int = 50,
):
self.entity = entity
self.collection_name = collection_name
self.type = type
self.project = project
self.filters = {"state": "COMMITTED"} if filters is None else filters
self.order = order
variables = {
"project": self.project,
"entity": self.entity,
"order": self.order,
"type": self.type,
"collection": self.collection_name,
"filters": json.dumps(self.filters),
}
self.QUERY = gql(
"""
query Artifacts($project: String!, $entity: String!, $type: String!, $collection: String!, $cursor: String, $perPage: Int = 50, $order: String, $filters: JSONString) {
project(name: $project, entityName: $entity) {
artifactType(name: $type) {
artifactCollection: %s(name: $collection) {
name
artifacts(filters: $filters, after: $cursor, first: $perPage, order: $order) {
totalCount
edges {
node {
...ArtifactFragment
}
version
cursor
}
pageInfo {
endCursor
hasNextPage
}
}
}
}
}
}
%s
"""
% (
artifact_collection_edge_name(
server_supports_artifact_collections_gql_edges(client)
),
ARTIFACT_FRAGMENT,
)
)
super().__init__(client, variables, per_page) | python | wandb/apis/public.py | 5,263 | 5,322 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,709 | length | def length(self):
if self.last_response:
return self.last_response["project"]["artifactType"]["artifactCollection"][
"artifacts"
]["totalCount"]
else:
return None | python | wandb/apis/public.py | 5,325 | 5,331 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,710 | more | def more(self):
if self.last_response:
return self.last_response["project"]["artifactType"]["artifactCollection"][
"artifacts"
]["pageInfo"]["hasNextPage"]
else:
return True | python | wandb/apis/public.py | 5,334 | 5,340 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,711 | cursor | def cursor(self):
if self.last_response:
return self.last_response["project"]["artifactType"]["artifactCollection"][
"artifacts"
]["edges"][-1]["cursor"]
else:
return None | python | wandb/apis/public.py | 5,343 | 5,349 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,712 | convert_objects | def convert_objects(self):
if self.last_response["project"]["artifactType"]["artifactCollection"] is None:
return []
return [
Artifact(
self.client,
self.entity,
self.project,
self.collection_name + ":" + a["version"],
a["node"],
)
for a in self.last_response["project"]["artifactType"][
"artifactCollection"
]["artifacts"]["edges"]
] | python | wandb/apis/public.py | 5,351 | 5,365 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,713 | __init__ | def __init__(
self,
client: Client,
artifact: Artifact,
names: Optional[Sequence[str]] = None,
per_page: int = 50,
):
self.artifact = artifact
variables = {
"entityName": artifact._birth_entity,
"projectName": artifact._birth_project,
"artifactTypeName": artifact.type,
"artifactName": artifact.name,
"fileNames": names,
}
# The server must advertise at least SDK 0.12.21
# to get storagePath
if not client.version_supported("0.12.21"):
self.QUERY = gql(self.QUERY.loc.source.body.replace("storagePath\n", ""))
super().__init__(client, variables, per_page) | python | wandb/apis/public.py | 5,393 | 5,412 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,714 | path | def path(self):
return [self.artifact.entity, self.artifact.project, self.artifact.name] | python | wandb/apis/public.py | 5,415 | 5,416 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,715 | length | def length(self):
return self.artifact.file_count | python | wandb/apis/public.py | 5,419 | 5,420 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,716 | more | def more(self):
if self.last_response:
return self.last_response["project"]["artifactType"]["artifact"]["files"][
"pageInfo"
]["hasNextPage"]
else:
return True | python | wandb/apis/public.py | 5,423 | 5,429 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,717 | cursor | def cursor(self):
if self.last_response:
return self.last_response["project"]["artifactType"]["artifact"]["files"][
"edges"
][-1]["cursor"]
else:
return None | python | wandb/apis/public.py | 5,432 | 5,438 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,718 | update_variables | def update_variables(self):
self.variables.update({"fileLimit": self.per_page, "fileCursor": self.cursor}) | python | wandb/apis/public.py | 5,440 | 5,441 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,719 | convert_objects | def convert_objects(self):
return [
File(self.client, r["node"])
for r in self.last_response["project"]["artifactType"]["artifact"]["files"][
"edges"
]
] | python | wandb/apis/public.py | 5,443 | 5,449 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,720 | __repr__ | def __repr__(self):
return "<ArtifactFiles {} ({})>".format("/".join(self.path), len(self)) | python | wandb/apis/public.py | 5,451 | 5,452 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,721 | __init__ | def __init__(self, api: Api, name, path: Optional[str] = None) -> None:
try:
self._job_artifact = api.artifact(name, type="job")
except CommError:
raise CommError(f"Job artifact {name} not found")
if path:
self._fpath = path
self._job_artifact.download(root=path)
else:
self._fpath = self._job_artifact.download()
self._name = name
self._api = api
self._entity = api.default_entity
with open(os.path.join(self._fpath, "wandb-job.json")) as f:
self._source_info: Mapping[str, Any] = json.load(f)
self._entrypoint = self._source_info.get("source", {}).get("entrypoint")
self._args = self._source_info.get("source", {}).get("args")
self._requirements_file = os.path.join(self._fpath, "requirements.frozen.txt")
self._input_types = TypeRegistry.type_from_dict(
self._source_info.get("input_types")
)
self._output_types = TypeRegistry.type_from_dict(
self._source_info.get("output_types")
)
if self._source_info.get("source_type") == "artifact":
self._set_configure_launch_project(self._configure_launch_project_artifact)
if self._source_info.get("source_type") == "repo":
self._set_configure_launch_project(self._configure_launch_project_repo)
if self._source_info.get("source_type") == "image":
self._set_configure_launch_project(self._configure_launch_project_container) | python | wandb/apis/public.py | 5,463 | 5,494 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,722 | name | def name(self):
return self._name | python | wandb/apis/public.py | 5,497 | 5,498 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,723 | _set_configure_launch_project | def _set_configure_launch_project(self, func):
self.configure_launch_project = func | python | wandb/apis/public.py | 5,500 | 5,501 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,724 | _configure_launch_project_repo | def _configure_launch_project_repo(self, launch_project):
git_info = self._source_info.get("source", {}).get("git", {})
_fetch_git_repo(
launch_project.project_dir,
git_info["remote"],
git_info["commit"],
)
if os.path.exists(os.path.join(self._fpath, "diff.patch")):
with open(os.path.join(self._fpath, "diff.patch")) as f:
apply_patch(f.read(), launch_project.project_dir)
shutil.copy(self._requirements_file, launch_project.project_dir)
launch_project.add_entry_point(self._entrypoint)
launch_project.python_version = self._source_info.get("runtime")
if self._args:
launch_project.override_args = util._user_args_to_dict(self._args) | python | wandb/apis/public.py | 5,503 | 5,517 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,725 | _configure_launch_project_artifact | def _configure_launch_project_artifact(self, launch_project):
artifact_string = self._source_info.get("source", {}).get("artifact")
if artifact_string is None:
raise LaunchError(f"Job {self.name} had no source artifact")
artifact_string, base_url, is_id = util.parse_artifact_string(artifact_string)
if is_id:
code_artifact = Artifact.from_id(artifact_string, self._api._client)
else:
code_artifact = self._api.artifact(name=artifact_string, type="code")
if code_artifact is None:
raise LaunchError("No code artifact found")
code_artifact.download(launch_project.project_dir)
shutil.copy(self._requirements_file, launch_project.project_dir)
launch_project.add_entry_point(self._entrypoint)
launch_project.python_version = self._source_info.get("runtime")
if self._args:
launch_project.override_args = util._user_args_to_dict(self._args) | python | wandb/apis/public.py | 5,519 | 5,535 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,726 | _configure_launch_project_container | def _configure_launch_project_container(self, launch_project):
launch_project.docker_image = self._source_info.get("source", {}).get("image")
if launch_project.docker_image is None:
raise LaunchError(
"Job had malformed source dictionary without an image key"
)
if self._entrypoint:
launch_project.add_entry_point(self._entrypoint)
if self._args:
launch_project.override_args = util._user_args_to_dict(self._args) | python | wandb/apis/public.py | 5,537 | 5,546 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,727 | set_entrypoint | def set_entrypoint(self, entrypoint: List[str]):
self._entrypoint = entrypoint | python | wandb/apis/public.py | 5,548 | 5,549 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,728 | call | def call(
self,
config,
project=None,
entity=None,
queue=None,
resource="local-container",
resource_args=None,
project_queue=None,
):
from wandb.sdk.launch import launch_add
run_config = {}
for key, item in config.items():
if util._is_artifact_object(item):
if isinstance(item, wandb.Artifact) and item.id is None:
raise ValueError("Cannot queue jobs with unlogged artifacts")
run_config[key] = util.artifact_to_json(item)
run_config.update(config)
assigned_config_type = self._input_types.assign(run_config)
if isinstance(assigned_config_type, InvalidType):
raise TypeError(self._input_types.explain(run_config))
queued_run = launch_add.launch_add(
job=self._name,
config={"overrides": {"run_config": run_config}},
project=project or self._project,
entity=entity or self._entity,
queue_name=queue,
resource=resource,
project_queue=project_queue,
resource_args=resource_args,
)
return queued_run | python | wandb/apis/public.py | 5,551 | 5,586 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,729 | parse_backend_error_messages | def parse_backend_error_messages(response: requests.Response) -> List[str]:
errors = []
try:
data = response.json()
except ValueError:
return errors
if "errors" in data and isinstance(data["errors"], list):
for error in data["errors"]:
# Our tests and potentially some api endpoints return a string error?
if isinstance(error, str):
error = {"message": error}
if "message" in error:
errors.append(error["message"])
return errors | python | wandb/apis/normalize.py | 17 | 31 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,730 | normalize_exceptions | def normalize_exceptions(func: _F) -> _F:
"""Function decorator for catching common errors and re-raising as wandb.Error."""
@wraps(func)
def wrapper(*args, **kwargs):
message = "Whoa, you found a bug."
try:
return func(*args, **kwargs)
except requests.HTTPError as error:
errors = parse_backend_error_messages(error.response)
if errors:
message = " ".join(errors)
message += (
f" (Error {error.response.status_code}: {error.response.reason})"
)
else:
message = error.response
raise CommError(message, error)
except RetryError as err:
if (
"response" in dir(err.last_exception)
and err.last_exception.response is not None
):
try:
message = err.last_exception.response.json().get(
"errors", [{"message": message}]
)[0]["message"]
except ValueError:
message = err.last_exception.response.text
else:
message = err.last_exception
if env.is_debug():
raise err.last_exception.with_traceback(sys.exc_info()[2])
else:
raise CommError(message, err.last_exception).with_traceback(
sys.exc_info()[2]
)
except Error as err:
raise err
except Exception as err:
# gql raises server errors with dict's as strings...
if len(err.args) > 0:
payload = err.args[0]
else:
payload = err
if str(payload).startswith("{"):
message = ast.literal_eval(str(payload))["message"]
else:
message = str(err)
if env.is_debug():
raise
else:
raise CommError(message, err).with_traceback(sys.exc_info()[2])
return wrapper | python | wandb/apis/normalize.py | 34 | 89 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,731 | wrapper | def wrapper(*args, **kwargs):
message = "Whoa, you found a bug."
try:
return func(*args, **kwargs)
except requests.HTTPError as error:
errors = parse_backend_error_messages(error.response)
if errors:
message = " ".join(errors)
message += (
f" (Error {error.response.status_code}: {error.response.reason})"
)
else:
message = error.response
raise CommError(message, error)
except RetryError as err:
if (
"response" in dir(err.last_exception)
and err.last_exception.response is not None
):
try:
message = err.last_exception.response.json().get(
"errors", [{"message": message}]
)[0]["message"]
except ValueError:
message = err.last_exception.response.text
else:
message = err.last_exception
if env.is_debug():
raise err.last_exception.with_traceback(sys.exc_info()[2])
else:
raise CommError(message, err.last_exception).with_traceback(
sys.exc_info()[2]
)
except Error as err:
raise err
except Exception as err:
# gql raises server errors with dict's as strings...
if len(err.args) > 0:
payload = err.args[0]
else:
payload = err
if str(payload).startswith("{"):
message = ast.literal_eval(str(payload))["message"]
else:
message = str(err)
if env.is_debug():
raise
else:
raise CommError(message, err).with_traceback(sys.exc_info()[2]) | python | wandb/apis/normalize.py | 38 | 87 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,732 | _disable_ssl | def _disable_ssl() -> Callable[[], None]:
# Because third party libraries may also use requests, we monkey patch it globally
# and turn off urllib3 warnings instead printing a global warning to the user.
termwarn(
"Disabling SSL verification. Connections to this server are not verified and may be insecure!"
)
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
old_merge_environment_settings = requests.Session.merge_environment_settings
def merge_environment_settings(self, url, proxies, stream, verify, cert):
settings = old_merge_environment_settings(
self, url, proxies, stream, verify, cert
)
settings["verify"] = False
return settings
requests.Session.merge_environment_settings = merge_environment_settings
def reset():
requests.Session.merge_environment_settings = old_merge_environment_settings
return reset | python | wandb/apis/__init__.py | 11 | 33 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,733 | merge_environment_settings | def merge_environment_settings(self, url, proxies, stream, verify, cert):
settings = old_merge_environment_settings(
self, url, proxies, stream, verify, cert
)
settings["verify"] = False
return settings | python | wandb/apis/__init__.py | 21 | 26 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,734 | reset | def reset():
requests.Session.merge_environment_settings = old_merge_environment_settings | python | wandb/apis/__init__.py | 30 | 31 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,735 | __init__ | def __init__(self, run, mlflow_client):
self.run = run
self.mlflow_client = mlflow_client
super().__init__() | python | wandb/apis/importers/mlflow.py | 14 | 17 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,736 | run_id | def run_id(self):
return self.run.info.run_id | python | wandb/apis/importers/mlflow.py | 19 | 20 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,737 | entity | def entity(self):
return self.run.info.user_id | python | wandb/apis/importers/mlflow.py | 22 | 23 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,738 | project | def project(self):
return "imported-from-mlflow" | python | wandb/apis/importers/mlflow.py | 25 | 26 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,739 | config | def config(self):
return self.run.data.params | python | wandb/apis/importers/mlflow.py | 28 | 29 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,740 | summary | def summary(self):
return self.run.data.metrics | python | wandb/apis/importers/mlflow.py | 31 | 32 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,741 | metrics | def metrics(self):
def wandbify(metrics):
for step, t in enumerate(metrics):
d = {m.key: m.value for m in t}
d["_step"] = step
yield d
metrics = [
self.mlflow_client.get_metric_history(self.run.info.run_id, k)
for k in self.run.data.metrics.keys()
]
metrics = zip(*metrics) # transpose
return wandbify(metrics)
# Alternate: Might be slower but use less mem
# Can't make this a generator. See mlflow get_metric_history internals
# https://github.com/mlflow/mlflow/blob/master/mlflow/tracking/_tracking_service/client.py#L74-L93
# for k in self.run.data.metrics.keys():
# history = self.mlflow_client.get_metric_history(self.run.info.run_id, k)
# yield wandbify(history) | python | wandb/apis/importers/mlflow.py | 34 | 53 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,742 | wandbify | def wandbify(metrics):
for step, t in enumerate(metrics):
d = {m.key: m.value for m in t}
d["_step"] = step
yield d | python | wandb/apis/importers/mlflow.py | 35 | 39 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,743 | run_group | def run_group(self):
# this is nesting? Parent at `run.info.tags.get("mlflow.parentRunId")`
return f"Experiment {self.run.info.experiment_id}" | python | wandb/apis/importers/mlflow.py | 55 | 57 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,744 | job_type | def job_type(self):
# Is this the right approach?
return f"User {self.run.info.user_id}" | python | wandb/apis/importers/mlflow.py | 59 | 61 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,745 | display_name | def display_name(self):
return self.run.info.run_name | python | wandb/apis/importers/mlflow.py | 63 | 64 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,746 | notes | def notes(self):
return self.run.data.tags.get("mlflow.note.content") | python | wandb/apis/importers/mlflow.py | 66 | 67 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,747 | tags | def tags(self):
return {
k: v for k, v in self.run.data.tags.items() if not k.startswith("mlflow.")
} | python | wandb/apis/importers/mlflow.py | 69 | 72 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,748 | start_time | def start_time(self):
return self.run.info.start_time // 1000 | python | wandb/apis/importers/mlflow.py | 74 | 75 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,749 | runtime | def runtime(self):
return self.run.info.end_time // 1_000 - self.start_time() | python | wandb/apis/importers/mlflow.py | 77 | 78 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,750 | git | def git(self):
... | python | wandb/apis/importers/mlflow.py | 80 | 81 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,751 | artifacts | def artifacts(self):
for f in self.mlflow_client.list_artifacts(self.run.info.run_id):
dir_path = mlflow.artifacts.download_artifacts(run_id=self.run.info.run_id)
full_path = dir_path + f.path
yield (f.path, full_path) | python | wandb/apis/importers/mlflow.py | 83 | 87 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,752 | __init__ | def __init__(
self, mlflow_tracking_uri, mlflow_registry_uri=None, wandb_base_url=None
) -> None:
super().__init__()
self.mlflow_tracking_uri = mlflow_tracking_uri
mlflow.set_tracking_uri(self.mlflow_tracking_uri)
if mlflow_registry_uri:
mlflow.set_registry_uri(mlflow_registry_uri)
self.mlflow_client = mlflow.tracking.MlflowClient(mlflow_tracking_uri) | python | wandb/apis/importers/mlflow.py | 91 | 100 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,753 | import_one | def import_one(
self,
run: ImporterRun,
overrides: Optional[Dict[str, Any]] = None,
) -> None:
mlflow.set_tracking_uri(self.mlflow_tracking_uri)
super().import_one(run, overrides) | python | wandb/apis/importers/mlflow.py | 102 | 108 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,754 | download_all_runs | def download_all_runs(self) -> Iterable[MlflowRun]:
for exp in self.mlflow_client.search_experiments():
for run in self.mlflow_client.search_runs(exp.experiment_id):
yield MlflowRun(run, self.mlflow_client) | python | wandb/apis/importers/mlflow.py | 110 | 113 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,755 | coalesce | def coalesce(*arg: Any) -> Any:
"""Return the first non-none value in the list of arguments. Similar to ?? in C#."""
return next((a for a in arg if a is not None), None) | python | wandb/apis/importers/base.py | 21 | 23 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,756 | send_manager | def send_manager(root_dir):
sm = SendManager.setup(root_dir, resume=False)
try:
yield sm
finally:
# flush any remaining records
while sm:
data = next(sm)
sm.send(data)
sm.finish() | python | wandb/apis/importers/base.py | 27 | 36 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,757 | __init__ | def __init__(self) -> None:
self.interface = InterfaceQueue()
self.run_dir = f"./wandb-importer/{self.run_id()}" | python | wandb/apis/importers/base.py | 40 | 42 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,758 | run_id | def run_id(self) -> str:
_id = wandb.util.generate_id()
wandb.termwarn(f"`run_id` not specified. Autogenerating id: {_id}")
return _id | python | wandb/apis/importers/base.py | 44 | 47 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,759 | entity | def entity(self) -> str:
_entity = "unspecified-entity"
wandb.termwarn(f"`entity` not specified. Defaulting to: {_entity}")
return _entity | python | wandb/apis/importers/base.py | 49 | 52 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,760 | project | def project(self) -> str:
_project = "unspecified-project"
wandb.termwarn(f"`project` not specified. Defaulting to: {_project}")
return _project | python | wandb/apis/importers/base.py | 54 | 57 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,761 | config | def config(self) -> Dict[str, Any]:
return {} | python | wandb/apis/importers/base.py | 59 | 60 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,762 | summary | def summary(self) -> Dict[str, float]:
return {} | python | wandb/apis/importers/base.py | 62 | 63 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,763 | metrics | def metrics(self) -> List[Dict[str, float]]:
"""Metrics for the run.
We expect metrics in this shape:
[
{'metric1': 1, 'metric2': 1, '_step': 0},
{'metric1': 2, 'metric2': 4, '_step': 1},
{'metric1': 3, 'metric2': 9, '_step': 2},
...
]
You can also submit metrics in this shape:
[
{'metric1': 1, '_step': 0},
{'metric2': 1, '_step': 0},
{'metric1': 2, '_step': 1},
{'metric2': 4, '_step': 1},
...
]
"""
return [] | python | wandb/apis/importers/base.py | 65 | 86 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,764 | run_group | def run_group(self) -> Optional[str]:
... | python | wandb/apis/importers/base.py | 88 | 89 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,765 | job_type | def job_type(self) -> Optional[str]:
... | python | wandb/apis/importers/base.py | 91 | 92 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,766 | display_name | def display_name(self) -> str:
return self.run_id() | python | wandb/apis/importers/base.py | 94 | 95 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,767 | notes | def notes(self) -> Optional[str]:
... | python | wandb/apis/importers/base.py | 97 | 98 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,768 | tags | def tags(self) -> Optional[List[str]]:
... | python | wandb/apis/importers/base.py | 100 | 101 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,769 | artifacts | def artifacts(self) -> Optional[Iterable[Tuple[Name, Path]]]:
... | python | wandb/apis/importers/base.py | 103 | 104 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,770 | os_version | def os_version(self) -> Optional[str]:
... | python | wandb/apis/importers/base.py | 106 | 107 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,771 | python_version | def python_version(self) -> Optional[str]:
... | python | wandb/apis/importers/base.py | 109 | 110 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,772 | cuda_version | def cuda_version(self) -> Optional[str]:
... | python | wandb/apis/importers/base.py | 112 | 113 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,773 | program | def program(self) -> Optional[str]:
... | python | wandb/apis/importers/base.py | 115 | 116 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,774 | host | def host(self) -> Optional[str]:
... | python | wandb/apis/importers/base.py | 118 | 119 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,775 | username | def username(self) -> Optional[str]:
... | python | wandb/apis/importers/base.py | 121 | 122 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,776 | executable | def executable(self) -> Optional[str]:
... | python | wandb/apis/importers/base.py | 124 | 125 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,777 | gpus_used | def gpus_used(self) -> Optional[str]:
... | python | wandb/apis/importers/base.py | 127 | 128 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,778 | cpus_used | def cpus_used(self) -> Optional[int]: # can we get the model?
... | python | wandb/apis/importers/base.py | 130 | 131 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,779 | memory_used | def memory_used(self) -> Optional[int]:
... | python | wandb/apis/importers/base.py | 133 | 134 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,780 | runtime | def runtime(self) -> Optional[int]:
... | python | wandb/apis/importers/base.py | 136 | 137 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,781 | start_time | def start_time(self) -> Optional[int]:
... | python | wandb/apis/importers/base.py | 139 | 140 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,782 | _make_run_record | def _make_run_record(self) -> pb.Record:
run = pb.RunRecord()
run.run_id = self.run_id()
run.entity = self.entity()
run.project = self.project()
run.display_name = coalesce(self.display_name())
run.notes = coalesce(self.notes(), "")
run.tags.extend(coalesce(self.tags(), list()))
# run.start_time.FromMilliseconds(self.start_time())
# run.runtime = self.runtime()
run_group = self.run_group()
if run_group is not None:
run.run_group = run_group
self.interface._make_config(
data=self.config(),
obj=run.config,
) # is there a better way?
return self.interface._make_record(run=run) | python | wandb/apis/importers/base.py | 142 | 159 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,783 | _make_summary_record | def _make_summary_record(self) -> pb.Record:
d: dict = {
**self.summary(),
"_runtime": self.runtime(), # quirk of runtime -- it has to be here!
# '_timestamp': self.start_time()/1000,
}
summary = self.interface._make_summary_from_dict(d)
return self.interface._make_record(summary=summary) | python | wandb/apis/importers/base.py | 161 | 168 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,784 | _make_history_records | def _make_history_records(self) -> Iterable[pb.Record]:
for _, metrics in enumerate(self.metrics()):
history = pb.HistoryRecord()
for k, v in metrics.items():
item = history.item.add()
item.key = k
item.value_json = json.dumps(v)
yield self.interface._make_record(history=history) | python | wandb/apis/importers/base.py | 170 | 177 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,785 | _make_files_record | def _make_files_record(self, files_dict) -> pb.Record:
# when making the metadata file, it captures most things correctly
# but notably it doesn't capture the start time!
files_record = pb.FilesRecord()
for path, policy in files_dict["files"]:
f = files_record.files.add()
f.path = path
f.policy = file_policy_to_enum(policy) # is this always "end"?
return self.interface._make_record(files=files_record) | python | wandb/apis/importers/base.py | 179 | 187 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,786 | _make_metadata_files_record | def _make_metadata_files_record(self) -> pb.Record:
self._make_metadata_file(self.run_dir)
return self._make_files_record(
{"files": [[f"{self.run_dir}/files/wandb-metadata.json", "end"]]}
) | python | wandb/apis/importers/base.py | 189 | 193 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,787 | _make_artifact_record | def _make_artifact_record(self) -> pb.Record:
art = wandb.Artifact(self.display_name(), "imported-artifacts")
artifacts = self.artifacts()
if artifacts is not None:
for name, path in artifacts:
art.add_file(path, name)
proto = self.interface._make_artifact(art)
proto.run_id = self.run_id()
proto.project = self.project()
proto.entity = self.entity()
proto.user_created = False
proto.use_after_commit = False
proto.finalize = True
for tag in ["latest", "imported"]:
proto.aliases.append(tag)
return self.interface._make_record(artifact=proto) | python | wandb/apis/importers/base.py | 195 | 210 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,788 | _make_telem_record | def _make_telem_record(self) -> pb.Record:
feature = telem_pb.Feature()
feature.importer_mlflow = True
telem = telem_pb.TelemetryRecord()
telem.feature.CopyFrom(feature)
telem.python_version = platform.python_version() # importer's python version
telem.cli_version = wandb.__version__
return self.interface._make_record(telemetry=telem) | python | wandb/apis/importers/base.py | 212 | 220 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,789 | _make_metadata_file | def _make_metadata_file(self, run_dir: str) -> None:
missing_text = "MLFlow did not capture this info."
d = {}
if self.os_version() is not None:
d["os"] = self.os_version()
else:
d["os"] = missing_text
if self.python_version() is not None:
d["python"] = self.python_version()
else:
d["python"] = missing_text
if self.program() is not None:
d["program"] = self.program()
else:
d["program"] = missing_text
if self.cuda_version() is not None:
d["cuda"] = self.cuda_version()
if self.host() is not None:
d["host"] = self.host()
if self.username() is not None:
d["username"] = self.username()
if self.executable() is not None:
d["executable"] = self.executable()
gpus_used = self.gpus_used()
if gpus_used is not None:
d["gpu_devices"] = json.dumps(gpus_used)
d["gpu_count"] = json.dumps(len(gpus_used))
cpus_used = self.cpus_used()
if cpus_used is not None:
d["cpu_count"] = json.dumps(self.cpus_used())
mem_used = self.memory_used()
if mem_used is not None:
d["memory"] = json.dumps({"total": self.memory_used()})
with open(f"{run_dir}/files/wandb-metadata.json", "w") as f:
f.write(json.dumps(d)) | python | wandb/apis/importers/base.py | 222 | 261 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,790 | download_all_runs | def download_all_runs(self) -> Iterable[ImporterRun]:
... | python | wandb/apis/importers/base.py | 266 | 267 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,791 | import_all | def import_all(self, overrides: Optional[Dict[str, Any]] = None) -> None:
for run in tqdm(self.download_all_runs(), desc="Sending runs"):
self.import_one(run, overrides) | python | wandb/apis/importers/base.py | 269 | 271 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,792 | import_all_parallel | def import_all_parallel(
self, overrides: Optional[Dict[str, Any]] = None, **pool_kwargs: Any
) -> None:
runs = list(self.download_all_runs())
with tqdm(total=len(runs)) as pbar:
with ProcessPoolExecutor(**pool_kwargs) as exc:
futures = {
exc.submit(self.import_one, run, overrides=overrides): run
for run in runs
}
for future in as_completed(futures):
run = futures[future]
pbar.update(1)
pbar.set_description(
f"Imported Run: {run.run_group()} {run.display_name()}"
) | python | wandb/apis/importers/base.py | 273 | 288 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,793 | import_one | def import_one(
self,
run: ImporterRun,
overrides: Optional[Dict[str, Any]] = None,
) -> None:
# does this need to be here for pmap?
if overrides:
for k, v in overrides.items():
# `lambda: v` won't work!
# https://stackoverflow.com/questions/10802002/why-deepcopy-doesnt-create-new-references-to-lambda-function
setattr(run, k, lambda v=v: v)
self._import_one(run) | python | wandb/apis/importers/base.py | 290 | 301 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,794 | _import_one | def _import_one(self, run: ImporterRun) -> None:
with send_manager(run.run_dir) as sm:
sm.send(run._make_run_record())
sm.send(run._make_summary_record())
sm.send(run._make_metadata_files_record())
for history_record in run._make_history_records():
sm.send(history_record)
if run.artifacts() is not None:
sm.send(run._make_artifact_record())
sm.send(run._make_telem_record()) | python | wandb/apis/importers/base.py | 303 | 312 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,795 | view_type | def view_type(self) -> str:
return "UNKNOWN PANEL" | python | wandb/apis/reports/_panels.py | 21 | 22 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,796 | __init__ | def __init__(
self,
title: Optional[str] = None,
x: Optional[str] = None,
y: Optional[Union[list, str]] = None,
range_x: Union[list, tuple] = (None, None),
range_y: Union[list, tuple] = (None, None),
log_x: Optional[bool] = None,
log_y: Optional[bool] = None,
title_x: Optional[str] = None,
title_y: Optional[str] = None,
ignore_outliers: Optional[bool] = None,
groupby: Optional[str] = None,
groupby_aggfunc: Optional[str] = None,
groupby_rangefunc: Optional[str] = None,
smoothing_factor: Optional[float] = None,
smoothing_type: Optional[str] = None,
smoothing_show_original: Optional[bool] = None,
max_runs_to_show: Optional[int] = None,
custom_expressions: Optional[str] = None,
plot_type: Optional[str] = None,
font_size: Optional[str] = None,
legend_position: Optional[str] = None,
legend_template: Optional[str] = None,
aggregate: Optional[bool] = None,
xaxis_expression: Optional[str] = None,
# line_titles: Optional[dict] = None,
# line_marks: Optional[dict] = None,
# line_colors: Optional[dict] = None,
# line_widths: Optional[dict] = None,
*args,
**kwargs,
):
super().__init__(*args, **kwargs)
self.title = title
self.x = x
self.y = y
self.range_x = range_x
self.range_y = range_y
self.log_x = log_x
self.log_y = log_y
self.title_x = title_x
self.title_y = title_y
self.ignore_outliers = ignore_outliers
self.groupby = groupby
self.groupby_aggfunc = groupby_aggfunc
self.groupby_rangefunc = groupby_rangefunc
self.smoothing_factor = smoothing_factor
self.smoothing_type = smoothing_type
self.smoothing_show_original = smoothing_show_original
self.max_runs_to_show = max_runs_to_show
self.custom_expressions = custom_expressions
self.plot_type = plot_type
self.font_size = font_size
self.legend_position = legend_position
self.legend_template = legend_template
self.aggregate = aggregate
self.xaxis_expression = xaxis_expression
# self.line_titles = line_titles
# self.line_marks = line_marks
# self.line_colors = line_colors
# self.line_widths = line_widths | python | wandb/apis/reports/_panels.py | 125 | 186 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,797 | x | def x(self):
json_path = self._get_path("x")
value = nested_get(self, json_path)
return self.panel_metrics_helper.back_to_front(value) | python | wandb/apis/reports/_panels.py | 189 | 192 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,798 | x | def x(self, value):
if value is None:
value = "Step"
json_path = self._get_path("x")
value = self.panel_metrics_helper.front_to_back(value)
nested_set(self, json_path, value) | python | wandb/apis/reports/_panels.py | 195 | 201 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,799 | y | def y(self):
json_path = self._get_path("y")
value = nested_get(self, json_path)
if value is None:
return value
return [self.panel_metrics_helper.back_to_front(v) for v in value] | python | wandb/apis/reports/_panels.py | 204 | 209 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
1,800 | y | def y(self, value):
json_path = self._get_path("y")
if value is not None:
if not isinstance(value, list):
value = [value]
value = [self.panel_metrics_helper.front_to_back(v) for v in value]
nested_set(self, json_path, value) | python | wandb/apis/reports/_panels.py | 212 | 218 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.