Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
Data Flow
Data Loading
Wellbore DDMS Data Loader
Commits
4f0a07e1
Commit
4f0a07e1
authored
Oct 06, 2021
by
Greg Harris
Browse files
Adding tests for build_well_log_data
parent
5835f20e
Changes
6
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
4f0a07e1
...
...
@@ -73,7 +73,6 @@ The LASCLI requires a configuration file that has the following JSON structure:
{
"data_partition_id": "opendes",
"acl_domain": "contoso.com",
"ref_curve_id": "DEPT",
"legal":
{
"legaltags": ["opendes-public-usa-dataset-7643990"],
...
...
src/example_opendes_configuration.json
View file @
4f0a07e1
{
"data_partition_id"
:
"opendes"
,
"acl_domain"
:
"contoso.com"
,
"ref_curve_id"
:
"DEPT"
,
"legal"
:
{
"legaltags"
:
[
"opendes-public-usa-dataset-7643990"
],
...
...
src/lasloader/record_mapper.py
View file @
4f0a07e1
...
...
@@ -181,7 +181,7 @@ class AttributeBuilder:
if
None
in
[
wellbore_id
]:
raise
ValueError
(
"Wellbore ID"
)
if
las
.
curves
[
0
].
mnemonic
is
not
None
and
las
.
curves
[
0
].
original_mnemonic
!=
""
:
if
las
.
curves
is
not
None
and
len
(
las
.
curves
)
>
0
and
las
.
curves
[
0
].
mnemonic
is
not
None
and
las
.
curves
[
0
].
original_mnemonic
!=
""
:
ref_curve_id
=
las
.
curves
[
0
].
mnemonic
else
:
raise
ValueError
(
"Failed to extract reference curve ID from LAS file."
)
...
...
src/test/test-config-files/config_example.json
View file @
4f0a07e1
...
...
@@ -8,7 +8,6 @@
],
"status"
:
"compliant"
},
"ref_curve_id"
:
"DEPT"
,
"data"
:
{
"default"
:
{
"viewers"
:
[
"data.default.viewers@opendes.contoso.com"
],
...
...
src/test/test-config-files/config_example_incomplete.json
View file @
4f0a07e1
...
...
@@ -4,7 +4,6 @@
"legaltags"
:
[
"opendes-public-usa-dataset-7643990"
],
"status"
:
"compliant"
},
"ref_curve_id"
:
"DEPT"
,
"data"
:
{
"default"
:
{
"viewers"
:
[
"data.default.viewers@opendes.contoso.com"
],
...
...
src/test/test_record_mapper.py
View file @
4f0a07e1
...
...
@@ -158,6 +158,43 @@ class TestWellboreAttributeBuilders:
"NameAliases"
:
attr_builder
.
_build_name_aliases
(
uwi
,
config
)
}
def
test_build_well_log_data_returns_expected_ref_curve_id
(
self
,
attr_builder
,
las
,
config
):
"""
The returned object should include two attributes - facility name and name aliases.
"""
# Arrange
# Act
data
=
attr_builder
.
build_well_log_data
(
las
,
config
,
"boreId"
)
# Assert
assert
data
==
{
"ReferenceCurveID"
:
las
.
curves
[
0
].
mnemonic
,
"Curves"
:
attr_builder
.
_build_curves
(
las
,
config
.
data_partition_id
),
"WellboreID"
:
"boreId:"
,
}
def
test_build_well_log_data_raises_on_no_curves
(
self
,
attr_builder
,
config
):
"""
The returned object should include two attributes - facility name and name aliases.
"""
# Arrange
las
=
Mock
()
las
.
curves
=
None
# Act
with
pytest
.
raises
(
ValueError
,
match
=
r
".*Failed to extract reference curve ID from LAS file.*"
):
attr_builder
.
build_well_log_data
(
las
,
config
,
"boreId"
)
las
.
curves
=
[]
# Act
with
pytest
.
raises
(
ValueError
,
match
=
r
".*Failed to extract reference curve ID from LAS file.*"
):
attr_builder
.
build_well_log_data
(
las
,
config
,
"boreId"
)
class
TestWellLogAttributeBuilders
:
def
test_build_curves_returns_list_of_curve_dictionaries
(
self
,
attr_builder
,
las
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment