Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
binary_c-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Izzard, Robert Dr (Maths & Physics)
binary_c-python
Commits
856e96e4
Commit
856e96e4
authored
4 years ago
by
David Hendriks
Browse files
Options
Downloads
Patches
Plain Diff
trying to fix the system errors
parent
cd104946
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
binarycpython/utils/grid.py
+30
-0
30 additions, 0 deletions
binarycpython/utils/grid.py
binarycpython/utils/grid_options_defaults.py
+1
-0
1 addition, 0 deletions
binarycpython/utils/grid_options_defaults.py
with
31 additions
and
0 deletions
binarycpython/utils/grid.py
+
30
−
0
View file @
856e96e4
...
...
@@ -2211,5 +2211,35 @@ class Population:
# Function to join the result dictionaries
# """
def
_check_binary_c_error
(
self
,
binary_c_output
,
argstring
):
"""
Function to check whether binary_c throws an error and handle accordingly.
TODO: build mechanism to stop the run if too many failing systems found
"""
# print(binary_c_output)
# print(argstring)
if
binary_c_output
.
startswith
(
"
SYSTEM_ERROR
"
):
# print('error found')
# Write arglines to file
with
open
(
os
.
path
.
join
(
self
.
grid_options
[
'
tmp_dir
'
],
'
failed_systems.txt
'
),
'
a+
'
)
as
f
:
f
.
write
(
argstring
)
try
:
error_code
=
int
(
binary_c_output
.
splitlines
()[
0
].
split
(
"
with error code
"
)[
-
1
].
split
(
"
:
"
)[
0
].
strip
())
print
(
int
(
error_code
))
# print(binary_c_output.splitlines()[0].split("with error code")[-1].split(":")[0])
if
not
error_code
in
self
.
grid_options
[
'
failing_systems_error_codes
'
]:
self
.
grid_options
[
'
failing_systems_error_codes
'
].
apppend
(
error_code
)
except
ValueError
:
print
(
"
failed to extract the error-code
"
)
self
.
grid_options
[
'
failed_count
'
]
+=
1
self
.
grid_options
[
''
]
################################################################################################
This diff is collapsed.
Click to expand it.
binarycpython/utils/grid_options_defaults.py
+
1
−
0
View file @
856e96e4
...
...
@@ -83,6 +83,7 @@ grid_options_defaults_dict = {
"
error
"
:
0
,
# error?
"
failed_count
"
:
0
,
# amt of failed systems
"
failed_prob
"
:
0
,
# Summed probability of failed systems
"
failed_systems_error_codes
"
:
[],
"
id
"
:
0
,
# Random id of this grid/population run,
"
modulo
"
:
1
,
# run modulo n of the grid.
## Grid type evolution
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment