Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pes_to_spec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Machine Learning projects.
pes_to_spec
Commits
2e7635d1
Commit
2e7635d1
authored
1 year ago
by
Danilo Ferreira de Lima
Browse files
Options
Downloads
Patches
Plain Diff
Created VS configuration.
parent
203b48c7
No related branches found
No related tags found
1 merge request
!26
Added example for SCS.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pes_to_spec/config.py
+18
-1
18 additions, 1 deletion
pes_to_spec/config.py
with
18 additions
and
1 deletion
pes_to_spec/config.py
+
18
−
1
View file @
2e7635d1
...
...
@@ -8,6 +8,7 @@ import re
import
numpy
as
np
from
copy
import
deepcopy
import
json
import
pandas
as
pd
class
VSConfig
(
object
):
"""
...
...
@@ -108,12 +109,13 @@ class VSConfig(object):
"""
diff
=
self
-
other
for
k
,
v
in
diff
.
voltage_mean
.
items
():
if
np
.
fabs
(
v
)
>
1e-2
:
if
np
.
fabs
(
v
)
>
0.1
:
return
False
if
np
.
log10
(
np
.
fabs
(
diff
.
pressure_mean
))
>
0.1
:
return
False
if
len
(
diff
.
gas_active
)
>
0
:
return
False
return
True
def
to_dict
(
self
)
->
Dict
[
str
,
Union
[
List
[
float
],
float
,
List
[
str
]]]:
"""
...
...
@@ -127,6 +129,21 @@ class VSConfig(object):
gas_active
=
list
(
self
.
gas_active
))
return
out
def
to_pandas
(
self
)
->
pd
.
DataFrame
:
"""
Return as a DataFrame.
"""
out
=
self
.
to_dict
()
data
=
dict
()
for
k
,
v
in
out
[
"
voltage_mean
"
].
items
():
data
[
f
"
mean_
{
k
}
"
]
=
[
v
]
for
k
,
v
in
out
[
"
voltage_std
"
].
items
():
data
[
f
"
std_
{
k
}
"
]
=
[
v
]
data
[
f
"
pressure_mean
"
]
=
[
out
[
"
pressure_mean
"
]]
data
[
f
"
pressure_std
"
]
=
[
out
[
"
pressure_std
"
]]
data
[
"
gas_active
"
]
=
[
"
_
"
.
join
(
out
[
"
gas_active
"
])]
return
pd
.
DataFrame
(
data
)
@staticmethod
def
from_dict
(
data
:
Dict
[
str
,
Union
[
List
[
float
],
float
,
List
[
str
]]])
->
'
VSConfig
'
:
"""
...
...
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