Skip to content

Commit f90f3ee

Browse files
committed
Format update
1 parent ce5a73a commit f90f3ee

File tree

8 files changed

+2
-20
lines changed

8 files changed

+2
-20
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
python contributors.py
113113
cd sphinx
114114
make clean
115-
make html
115+
make html
116116
117117
- name: Install and test with OMV
118118
if: ${{ matrix.runs-on != 'windows-latest' }}

docs/sphinx/source/api/Contributors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Modelspec contributors
44

55
This page list names and Github profiles of contributors to Modelspec, listed in no particular order.
6-
This page is generated periodically, most recently on 2024-04-12.
6+
This page is generated periodically, most recently on 2024-04-25.
77

88
- Padraig Gleeson ([@pgleeson](https://github.com/pgleeson))
99
- Manifest Chakalov ([@mqnifestkelvin](https://github.com/mqnifestkelvin))

examples/neuroml2/neuroml2_spec.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ class neuroml(Base):
128128

129129

130130
if __name__ == "__main__":
131-
132131
nml_doc = neuroml(id="TestNeuroML")
133132

134133
izh = izhikevich2007Cell(

examples/sbml/sbml32spec.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ class SBase(Base):
8282

8383
@modelspec.define
8484
class SBaseWithId(SBase):
85-
8685
id: str = field(default=None, validator=optional([instance_of(str), valid_sid]))
8786

8887

examples/sbml/sbml_validators.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ def validate_sbml(doc, units_consistency: bool = False) -> None:
168168

169169

170170
if __name__ == "__main__":
171-
172171
import libsbml
173172

174173
sbml_file = sys.argv[1]

src/modelspec/base_types.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ def from_dict(cls, d: Dict[str, Any]) -> "Base":
147147
# If this object has an id attribute, it may have been serialized within a dict with the id as the key, even if
148148
# it is a single object.
149149
if "id" in [f.name for f in attr.fields(cls)] and "id" not in d.keys():
150-
151150
keys = list(d.keys())
152151
if len(keys) == 0:
153152
raise ValueError(
@@ -297,7 +296,6 @@ def to_yaml_file(
297296
filename = f"{self.id}.yaml"
298297

299298
with open(filename, "w") as outfile:
300-
301299
# We need to setup another
302300
yaml.dump(
303301
yaml_converter.unstructure(self.to_dict()),
@@ -313,7 +311,6 @@ def to_xml_file(
313311
filename: Optional[str] = None,
314312
include_metadata: bool = True,
315313
) -> str:
316-
317314
if filename is None:
318315
filename = f"{self.id}.xml"
319316

@@ -636,7 +633,6 @@ def _is_base_type(
636633
can_be_none=False,
637634
can_be_eval_expr=False,
638635
):
639-
640636
import numpy
641637

642638
if verbose:
@@ -730,7 +726,6 @@ def _cls_generate_documentation(cls, format: str = MARKDOWN_FORMAT):
730726
rst_url_format = "`%s <%s>`__"
731727

732728
def insert_links(text, format=MARKDOWN_FORMAT):
733-
734729
code_ref = ":code:`"
735730
# print(" > Converting: %s" % text)
736731
text2 = text

src/modelspec/utils.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,12 @@ def convert_xml_dict_values(value):
192192

193193

194194
def save_to_json_file(info_dict, filename, indent=4):
195-
196195
strj = json.dumps(info_dict, indent=indent)
197196
with open(filename, "w") as fp:
198197
fp.write(strj)
199198

200199

201200
def save_to_yaml_file(info_dict, filename, indent=4):
202-
203201
if sys.version_info[0] == 2:
204202
stry = yaml.dump(info_dict, indent=indent, default_flow_style=False)
205203
else:
@@ -251,7 +249,6 @@ def build_xml_element(data, parent=None):
251249

252250
attrs = attr.fields(data.__class__)
253251
for aattr in attrs:
254-
255252
print_(" == Looking at: {} ({})".format(aattr, type(aattr)), verbose)
256253
if isinstance(aattr.default, attr.Factory):
257254
children = data.__getattribute__(aattr.name)
@@ -280,7 +277,6 @@ def build_xml_element(data, parent=None):
280277
):
281278
parent.set(attribute_name, str(attribute_value))
282279
elif type(attribute_value) == dict:
283-
284280
"""for k, v in attribute_value.items():
285281
child_element = build_xml_element(v)"""
286282
else:
@@ -309,7 +305,6 @@ def ascii_encode_dict(data):
309305

310306

311307
def _parse_element(dict_format, to_build):
312-
313308
print_("Parse for element: [%s]" % dict_format, verbose)
314309
for k in dict_format.keys():
315310
print_(
@@ -323,7 +318,6 @@ def _parse_element(dict_format, to_build):
323318

324319

325320
def _parse_attributes(dict_format, to_build):
326-
327321
for key in dict_format:
328322
value = dict_format[key]
329323
new_format = True
@@ -489,7 +483,6 @@ def evaluate(
489483
else:
490484
expr = int(expr)
491485
except:
492-
493486
try:
494487
if array_format == FORMAT_TENSORFLOW:
495488
expr = tf.constant(float(expr))
@@ -557,7 +550,6 @@ def evaluate(
557550
)
558551

559552
if (type(v) is float or type(v) is str) and int(v) == v:
560-
561553
print_(" Returning int: %s" % int(v), verbose)
562554

563555
if array_format == FORMAT_TENSORFLOW:
@@ -576,7 +568,6 @@ def evaluate(
576568

577569

578570
def parse_list_like(list_str):
579-
580571
if isinstance(list_str, int):
581572
return [list_str]
582573
elif isinstance(list_str, float):

tests/test_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
class TestUtils(unittest.TestCase):
1414
def test_evaluate(self):
15-
1615
assert evaluate("33") == 33.0
1716
assert evaluate("33") == 33
1817
assert evaluate(33) == 33

0 commit comments

Comments
 (0)