mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
pre-commit: introduce codespell check
* codespell --ignore-words-list="ba,datas,fo" * up-to-date -> uptodate * Add pre-commit hook... * Pre-commit needs quotes? * Single quotes? * Arrrgggsss * Update .pre-commit-config.yaml Co-authored-by: Saugat Pachhai <[email protected]> Co-authored-by: Saugat Pachhai <[email protected]>
This commit is contained in:
co-authored by
Saugat Pachhai
parent
9d9ff10be1
commit
40f24e5668
@@ -7,6 +7,13 @@ repos:
|
|||||||
language_version: python3
|
language_version: python3
|
||||||
repo: https://github.com/ambv/black
|
repo: https://github.com/ambv/black
|
||||||
rev: 21.6b0
|
rev: 21.6b0
|
||||||
|
- hooks:
|
||||||
|
- id: codespell
|
||||||
|
args:
|
||||||
|
- --ignore-words-list
|
||||||
|
- ba,datas,fo,uptodate
|
||||||
|
repo: https://github.com/codespell-project/codespell
|
||||||
|
rev: v2.1.0
|
||||||
- hooks:
|
- hooks:
|
||||||
- id: isort
|
- id: isort
|
||||||
language_version: python3
|
language_version: python3
|
||||||
|
|||||||
+1
-1
@@ -184,7 +184,7 @@ Comparison to related technologies
|
|||||||
|
|
||||||
#. *Data Engineering* tools such as `AirFlow <https://airflow.apache.org/>`_, `Luigi <https://github.com/spotify/luigi>`_ and
|
#. *Data Engineering* tools such as `AirFlow <https://airflow.apache.org/>`_, `Luigi <https://github.com/spotify/luigi>`_ and
|
||||||
others - in DVC data, model and ML pipelines represent a single ML project and focuses on data scientist' experience while
|
others - in DVC data, model and ML pipelines represent a single ML project and focuses on data scientist' experience while
|
||||||
data engineering pipeline orchestrates multiple data projects and focuses on efficent execution. DVC project can be used
|
data engineering pipeline orchestrates multiple data projects and focuses on efficient execution. DVC project can be used
|
||||||
from data pipeline as a single execution step. `AirFlow DVC <https://github.com/covid-genomics/airflow-dvc>`_ is an example
|
from data pipeline as a single execution step. `AirFlow DVC <https://github.com/covid-genomics/airflow-dvc>`_ is an example
|
||||||
of such integration.
|
of such integration.
|
||||||
|
|
||||||
|
|||||||
+10
-10
@@ -163,7 +163,7 @@ class AsciiCanvas:
|
|||||||
self.point(x0 + width, y0 + height, "+")
|
self.point(x0 + width, y0 + height, "+")
|
||||||
|
|
||||||
|
|
||||||
def _build_sugiyama_layout(vertexes, edges):
|
def _build_sugiyama_layout(vertices, edges):
|
||||||
#
|
#
|
||||||
# Just a reminder about naming conventions:
|
# Just a reminder about naming conventions:
|
||||||
# +------------X
|
# +------------X
|
||||||
@@ -174,17 +174,17 @@ def _build_sugiyama_layout(vertexes, edges):
|
|||||||
# Y
|
# Y
|
||||||
#
|
#
|
||||||
|
|
||||||
vertexes = {v: Vertex(f" {v} ") for v in vertexes}
|
vertices = {v: Vertex(f" {v} ") for v in vertices}
|
||||||
# NOTE: reverting edges to correctly orientate the graph
|
# NOTE: reverting edges to correctly orientate the graph
|
||||||
edges = [Edge(vertexes[e], vertexes[s]) for s, e in edges]
|
edges = [Edge(vertices[e], vertices[s]) for s, e in edges]
|
||||||
vertexes = vertexes.values()
|
vertices = vertices.values()
|
||||||
graph = Graph(vertexes, edges)
|
graph = Graph(vertices, edges)
|
||||||
|
|
||||||
for vertex in vertexes:
|
for vertex in vertices:
|
||||||
vertex.view = VertexViewer(vertex.data)
|
vertex.view = VertexViewer(vertex.data)
|
||||||
|
|
||||||
# NOTE: determine min box length to create the best layout
|
# NOTE: determine min box length to create the best layout
|
||||||
minw = min(v.view.w for v in vertexes)
|
minw = min(v.view.w for v in vertices)
|
||||||
|
|
||||||
for edge in edges:
|
for edge in edges:
|
||||||
edge.view = EdgeViewer()
|
edge.view = EdgeViewer()
|
||||||
@@ -204,11 +204,11 @@ def _build_sugiyama_layout(vertexes, edges):
|
|||||||
return sug
|
return sug
|
||||||
|
|
||||||
|
|
||||||
def draw(vertexes, edges):
|
def draw(vertices, edges):
|
||||||
"""Build a DAG and draw it in ASCII.
|
"""Build a DAG and draw it in ASCII.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
vertexes (list): list of graph vertexes.
|
vertices (list): list of graph vertices.
|
||||||
edges (list): list of graph edges.
|
edges (list): list of graph edges.
|
||||||
"""
|
"""
|
||||||
# pylint: disable=too-many-locals
|
# pylint: disable=too-many-locals
|
||||||
@@ -217,7 +217,7 @@ def draw(vertexes, edges):
|
|||||||
Xs = [] # pylint: disable=invalid-name
|
Xs = [] # pylint: disable=invalid-name
|
||||||
Ys = [] # pylint: disable=invalid-name
|
Ys = [] # pylint: disable=invalid-name
|
||||||
|
|
||||||
sug = _build_sugiyama_layout(vertexes, edges)
|
sug = _build_sugiyama_layout(vertices, edges)
|
||||||
|
|
||||||
for vertex in sug.g.sV:
|
for vertex in sug.g.sV:
|
||||||
# NOTE: moving boxes w/2 to the left
|
# NOTE: moving boxes w/2 to the left
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@ _DEFAULT_CREDS_STEPS = (
|
|||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def _temp_event_loop():
|
def _temp_event_loop():
|
||||||
"""When trying to initalize azure filesystem instances
|
"""When trying to initialize azure filesystem instances
|
||||||
with DefaultCredentials, the authentication process requires
|
with DefaultCredentials, the authentication process requires
|
||||||
to have an access to a separate event loop. The normal calls
|
to have an access to a separate event loop. The normal calls
|
||||||
are run in a separate loop managed by the fsspec, but the
|
are run in a separate loop managed by the fsspec, but the
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class FSSpecWrapper(BaseFileSystem):
|
|||||||
yield entry
|
yield entry
|
||||||
|
|
||||||
def _entry_hook(self, entry):
|
def _entry_hook(self, entry):
|
||||||
"""Simple hook method to be overriden when wanted to process
|
"""Simple hook method to be overridden when wanted to process
|
||||||
entries within info() and ls(detail=True) calls"""
|
entries within info() and ls(detail=True) calls"""
|
||||||
return entry
|
return entry
|
||||||
|
|
||||||
|
|||||||
@@ -753,7 +753,7 @@ class Experiments:
|
|||||||
assert entry.index == 0
|
assert entry.index == 0
|
||||||
|
|
||||||
# NOTE: the stash commit to be popped already contains all the current
|
# NOTE: the stash commit to be popped already contains all the current
|
||||||
# workspace changes plus CLI modifed --params changes.
|
# workspace changes plus CLI modified --params changes.
|
||||||
# `checkout --force` here will not lose any data (popping stash commit
|
# `checkout --force` here will not lose any data (popping stash commit
|
||||||
# will result in conflict between workspace params and stashed CLI
|
# will result in conflict between workspace params and stashed CLI
|
||||||
# params, but we always want the stashed version).
|
# params, but we always want the stashed version).
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ class BaseGitBackend(ABC):
|
|||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def get_refs_containing(self, rev: str, pattern: Optional[str] = None):
|
def get_refs_containing(self, rev: str, pattern: Optional[str] = None):
|
||||||
"""Iterate over all git refs containing the specfied revision."""
|
"""Iterate over all git refs containing the specified revision."""
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def push_refspec(
|
def push_refspec(
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ Source: "{#MyAppDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs c
|
|||||||
|
|
||||||
[Tasks]
|
[Tasks]
|
||||||
Name: modifypath; Description: Adds dvc's application directory to environmental path; Flags: checkablealone;
|
Name: modifypath; Description: Adds dvc's application directory to environmental path; Flags: checkablealone;
|
||||||
Name: modifypath\system; Description: Adds dvc's application directory to enviromental path for all users;
|
Name: modifypath\system; Description: Adds dvc's application directory to environmental path for all users;
|
||||||
Name: addsymlinkpermissions; Description: Add permission for creating symbolic links; Flags: checkablealone;
|
Name: addsymlinkpermissions; Description: Add permission for creating symbolic links; Flags: checkablealone;
|
||||||
Name: addsymlinkpermissions\system; Description: Add permissions for creating symbolic links for all users;
|
Name: addsymlinkpermissions\system; Description: Add permissions for creating symbolic links for all users;
|
||||||
|
|
||||||
|
|||||||
@@ -571,7 +571,7 @@ def test_raise_on_wrong_field(tmp_dir, scm, dvc, run_copy_metrics):
|
|||||||
|
|
||||||
|
|
||||||
def test_load_metric_from_dict_json(tmp_dir):
|
def test_load_metric_from_dict_json(tmp_dir):
|
||||||
metric = [{"acccuracy": 1, "loss": 2}, {"accuracy": 3, "loss": 4}]
|
metric = [{"accuracy": 1, "loss": 2}, {"accuracy": 3, "loss": 4}]
|
||||||
dmetric = {"train": metric}
|
dmetric = {"train": metric}
|
||||||
|
|
||||||
plot_data = JSONPlotData("-", "revision", json.dumps(dmetric))
|
plot_data = JSONPlotData("-", "revision", json.dumps(dmetric))
|
||||||
@@ -584,7 +584,7 @@ def test_load_metric_from_dict_json(tmp_dir):
|
|||||||
|
|
||||||
|
|
||||||
def test_load_metric_from_dict_yaml(tmp_dir):
|
def test_load_metric_from_dict_yaml(tmp_dir):
|
||||||
metric = [{"acccuracy": 1, "loss": 2}, {"accuracy": 3, "loss": 4}]
|
metric = [{"accuracy": 1, "loss": 2}, {"accuracy": 3, "loss": 4}]
|
||||||
dmetric = {"train": metric}
|
dmetric = {"train": metric}
|
||||||
|
|
||||||
plot_data = YAMLPlotData("-", "revision", dumps_yaml(dmetric))
|
plot_data = YAMLPlotData("-", "revision", dumps_yaml(dmetric))
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ def test_status_non_dvc_repo_import(tmp_dir, dvc, git_dir):
|
|||||||
|
|
||||||
|
|
||||||
def test_status_before_and_after_dvc_init(tmp_dir, dvc, git_dir):
|
def test_status_before_and_after_dvc_init(tmp_dir, dvc, git_dir):
|
||||||
git_dir.scm_gen("file", "first version", commit="first verison")
|
git_dir.scm_gen("file", "first version", commit="first version")
|
||||||
old_rev = git_dir.scm.get_rev()
|
old_rev = git_dir.scm.get_rev()
|
||||||
|
|
||||||
dvc.imp(os.fspath(git_dir), "file", "file")
|
dvc.imp(os.fspath(git_dir), "file", "file")
|
||||||
|
|||||||
Reference in New Issue
Block a user