Skip to content

Commit 653745a

Browse files
authored
Merge pull request #5 from f0uriest/dev
Dev
2 parents 75ccbee + 9e349fa commit 653745a

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

README.rst

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
keras2c
33
#######
44

5-
|Build-Status| |Codecov| |Codacy|
5+
|Build-Status| |Codecov|
66

77
|License| |DOI|
88

@@ -89,9 +89,6 @@ The project is licensed under the MIT license.
8989
.. |Codecov| image:: https://codecov.io/gh/f0uriest/keras2c/branch/master/graph/badge.svg
9090
:target: https://codecov.io/gh/f0uriest/keras2c
9191
:alt: Code Coverage
92-
.. |Codacy| image:: https://api.codacy.com/project/badge/Grade/ac0b3f7d65a64a1f987463a81d2e1596
93-
:target: https://www.codacy.com/app/f0uriest/keras2c?utm_source=github.com&utm_medium=referral&utm_content=f0uriest/keras2c&utm_campaign=Badge_Grade
94-
:alt: Code Quality
9592
.. |License| image:: https://img.shields.io/badge/License-MIT-blue.svg
9693
:target: https://github.com/f0uriest/keras2c/blob/master/LICENSE
9794
:alt: License: MIT

keras2c/keras2c_main.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,11 @@ def model2c(model, function_name, malloc=False, verbose=True):
9494
header.write(term_sig + '; \n')
9595
if stateful:
9696
header.write(reset_sig + '; \n')
97-
if not subprocess.run(['astyle', '--version']).returncode:
97+
try:
9898
subprocess.run(['astyle', '-n', function_name + '.h'])
9999
subprocess.run(['astyle', '-n', function_name + '.c'])
100+
except FileNotFoundError:
101+
print("astyle not found, {} and {} will not be auto-formatted".format(function_name + ".h", function_name + ".c"))
100102

101103
return malloc_vars.keys(), stateful
102104

keras2c/make_test_suite.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -174,5 +174,7 @@ def make_test_suite(model, function_name, malloc_vars, num_tests=10, stateful=Fa
174174
return x;}\n\n"""
175175
file.write(s)
176176
file.close()
177-
if not subprocess.run(['astyle', '--version']).returncode:
177+
try:
178178
subprocess.run(['astyle', '-n', function_name + '_test_suite.c'])
179+
except FileNotFoundError:
180+
print("astyle not found, {} will not be auto-formatted".format(function_name + "_test_suite.c"))

0 commit comments

Comments
 (0)