From 42c1b1d10c6ada308d75e2f57f0eacc25508a61c Mon Sep 17 00:00:00 2001 From: Plamen Dimitrov Date: Sat, 16 Apr 2022 18:12:05 +0300 Subject: [PATCH] Fix inconsistent cnf structure method naming Part of the API methods were using "from/to_cnfvar_dict" while the other part were using "from/to_cnf_structure". --- src/cnfvar/model.py | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cnfvar/model.py b/src/cnfvar/model.py index 168f5db..aff7c38 100644 --- a/src/cnfvar/model.py +++ b/src/cnfvar/model.py @@ -494,7 +494,7 @@ class CnfListSerializationMixin(BaseCnfList): """ if renumber: self.renumber() - return {"cnf": [x.to_cnfvar_dict() for x in self]} + return {"cnf": [x.to_cnf_structure() for x in self]} def to_cnf_file(self, path, renumber=True, encoding=ENCODING): """ @@ -612,7 +612,7 @@ class CnfListSerializationMixin(BaseCnfList): class CnfSerializationMixin(BaseCnf): """Add serialization support to BaseCnf.""" - def to_cnfvar_dict(self): + def to_cnf_structure(self): """ Convert this instance to dictionary from the :py:mod:`cnfvar` module. @@ -633,7 +633,7 @@ class CnfSerializationMixin(BaseCnf): if self.comment is not None: d["comment"] = self.comment if len(self.children) > 0: - d["children"] = [c.to_cnfvar_dict() for c in self.children] + d["children"] = [c.to_cnf_structure() for c in self.children] return d def to_json_string(self, renumber=True): -- 1.7.1