FAQ
| This is a
LIVE
service |
Changelog
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
solventmapcreator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Yusuf Hamied Department of Chemistry
Hunter Group
SSIPtools
SSIMPLEapps
solventmapcreator
Commits
74364580
Commit
74364580
authored
7 years ago
by
M.D. Driver
Browse files
Options
Downloads
Patches
Plain Diff
add methods to read in files with split fitting.
parent
17be5336
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
solventmapcreator/io/polynomialdatareader.py
+8
-1
8 additions, 1 deletion
solventmapcreator/io/polynomialdatareader.py
solventmapcreator/test/iotest/polynomialdatareadertest.py
+23
-0
23 additions, 0 deletions
solventmapcreator/test/iotest/polynomialdatareadertest.py
with
31 additions
and
1 deletion
solventmapcreator/io/polynomialdatareader.py
+
8
−
1
View file @
74364580
...
...
@@ -38,7 +38,14 @@ def parse_polynomial_data_file(filename):
data_in
=
read_polynomial_data_file
(
filename
)
for
line_list
in
data_in
[
1
:]:
polynomial_data
=
read_polynomial_data_line
(
line_list
)
polynomial_data_dict
[
polynomial_data
[
"
order
"
]]
=
polynomial_data
if
"
fit_range
"
in
polynomial_data
:
fit_range
=
polynomial_data
.
pop
(
"
fit_range
"
)
if
polynomial_data
[
"
order
"
]
in
polynomial_data_dict
:
polynomial_data_dict
[
polynomial_data
[
"
order
"
]][
fit_range
]
=
polynomial_data
else
:
polynomial_data_dict
[
polynomial_data
[
"
order
"
]]
=
{
fit_range
:
polynomial_data
}
else
:
polynomial_data_dict
[
polynomial_data
[
"
order
"
]]
=
polynomial_data
return
polynomial_data_dict
def
read_polynomial_data_file
(
filename
):
...
...
This diff is collapsed.
Click to expand it.
solventmapcreator/test/iotest/polynomialdatareadertest.py
+
23
−
0
View file @
74364580
...
...
@@ -75,6 +75,29 @@ class PolynomialDataReaderTestCase(unittest.TestCase):
self
.
assertEqual
(
expected_dictionary
[
key
],
actual_dictionary
[
key
])
else
:
np
.
testing
.
assert_array_almost_equal
(
expected_dictionary
[
key
],
actual_dictionary
[
key
])
expected_poly_dict2
=
{
1
:{
"
positive
"
:
self
.
expected_data_by_solvent_id
[
"
expected,poly,fit
"
][
1
],
"
negative
"
:
self
.
expected_data_by_solvent_id
[
"
expected,poly,fit
"
][
1
]}}
actual_poly_dict2
=
polynomialdatareader
.
parse_polynomial_data_file
(
"
resources/expected_poly_fit2.csv
"
)
for
poly_order
in
expected_poly_dict2
.
keys
():
expected_mix_dictionary
=
expected_poly_dict2
[
poly_order
]
actual_mix_dictionary
=
actual_poly_dict2
[
poly_order
]
self
.
assertListEqual
(
sorted
(
expected_mix_dictionary
.
keys
()),
sorted
(
actual_mix_dictionary
.
keys
()))
for
key
in
expected_mix_dictionary
.
keys
():
actual_dictionary
=
actual_mix_dictionary
[
key
]
expected_dictionary
=
expected_mix_dictionary
[
key
]
self
.
assertListEqual
(
sorted
(
expected_dictionary
.
keys
()),
sorted
(
actual_dictionary
.
keys
()))
for
key
in
expected_dictionary
.
keys
():
if
key
==
"
RMSE
"
:
self
.
assertAlmostEqual
(
expected_dictionary
[
key
],
actual_dictionary
[
key
])
elif
key
==
"
order
"
:
self
.
assertEqual
(
expected_dictionary
[
key
],
actual_dictionary
[
key
])
else
:
np
.
testing
.
assert_array_almost_equal
(
expected_dictionary
[
key
],
actual_dictionary
[
key
])
def
test_read_polynomial_data_file
(
self
):
"""
Test to see if file is read as expected.
"""
...
...
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