From 3c78483c2973c7c21059dd80cf9bcd009c7d7d75 Mon Sep 17 00:00:00 2001 From: Matt Hall Date: Wed, 23 Feb 2022 10:39:55 -0400 Subject: [PATCH] updates to tests and docs --- CHANGES.md | 6 +- docs/_userguide/Projects.ipynb | 149 ++++++++++++--------------------- docs/post_process_html.py | 4 +- tests/assets/barebones.las | 12 +++ tests/assets/sample.las | 46 ++++++++++ tests/assets/sample_2.1.las | 47 +++++++++++ 6 files changed, 167 insertions(+), 97 deletions(-) create mode 100644 tests/assets/barebones.las create mode 100644 tests/assets/sample.las create mode 100644 tests/assets/sample_2.1.las diff --git a/CHANGES.md b/CHANGES.md index eaac481a..7406a430 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,12 +1,16 @@ # Changelog +## 0.5.2rc0, 23 February 2022 + +- Fixed [bug #208](https://github.com/agile-geoscience/welly/issues/208) which essentially meant `rename_alias` was always `False` when getting a well or project as a DataFrame. + ## 0.5.1, 18 February 2022 - `Curve.values` now returns a 1D array for a 1D curve. - Added `Project.basis_range` to provide the min and max of all curves in the project. - Added [a user guide page for `Project`](https://code.agilescientific.com/welly/userguide/projects.html). - Fixed [bug #202](https://github.com/agile-geoscience/welly/issues/202) with curve indexing. -- Fixed [bug #206](https://github.com/agile-geoscience/welly/issues/206) that prvented quality tests from running on aliased curves. +- Fixed [bug #206](https://github.com/agile-geoscience/welly/issues/206) that prevented quality tests from running on aliased curves. - Fixed [bug #207](https://github.com/agile-geoscience/welly/issues/207) that was causing the quality table not to render correctly in some situations. ## 0.5.0, 14 February 2022 diff --git a/docs/_userguide/Projects.ipynb b/docs/_userguide/Projects.ipynb index b520fcf7..ae90b4a5 100644 --- a/docs/_userguide/Projects.ipynb +++ b/docs/_userguide/Projects.ipynb @@ -23,7 +23,7 @@ { "data": { "text/plain": [ - "'0.5.1.dev8+g5fa6568.d20220218'" + "'0.5.1.dev15+gbf10f3b.d20220223'" ] }, "execution_count": 1, @@ -57,7 +57,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "2it [00:00, 16.85it/s]\n" + "2it [00:00, 19.00it/s]\n" ] } ], @@ -112,7 +112,7 @@ "output_type": "stream", "text": [ "0it [00:00, ?it/s]Only engine='normal' can read wrapped files\n", - "3it [00:04, 1.55s/it]\n" + "3it [00:06, 2.09s/it]\n" ] } ], @@ -214,7 +214,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -263,8 +263,10 @@ }, { "cell_type": "code", - "execution_count": 9, - "metadata": {}, + "execution_count": 11, + "metadata": { + "scrolled": false + }, "outputs": [ { "data": { @@ -275,7 +277,7 @@ "Well(uwi: 'Kennetcook #2', name: 'Kennetcook #2', 24 curves: ['CALI', 'HCAL', 'PEF', 'DT', 'DTS', 'DPHI_SAN', 'DPHI_LIM', 'DPHI_DOL', 'NPHI_SAN', 'NPHI_LIM', 'NPHI_DOL', 'RLA5', 'RLA3', 'RLA4', 'RLA1', 'RLA2', 'RXOZ', 'RXO_HRLT', 'RT_HRLT', 'RM_HRLT', 'DRHO', 'RHOB', 'GR', 'SP'])" ] }, - "execution_count": 9, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -296,7 +298,27 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'Sonic': ['DT', 'DT4P'], 'Caliper': ['HCAL', 'CALI']}" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "alias" + ] + }, + { + "cell_type": "code", + "execution_count": 16, "metadata": {}, "outputs": [ { @@ -321,11 +343,9 @@ " \n", " \n", " \n", - " HCAL\n", + " Caliper\n", " GR\n", - " DT\n", - " CALI\n", - " DT4P\n", + " Sonic\n", " \n", " \n", " UWI\n", @@ -333,8 +353,6 @@ " \n", " \n", " \n", - " \n", - " \n", " \n", " \n", " \n", @@ -344,40 +362,30 @@ " 4.3912849426\n", " 46.6986503600\n", " NaN\n", - " NaN\n", - " NaN\n", " \n", " \n", " 1.2192000000\n", " 4.3912849426\n", " 46.6986503600\n", " NaN\n", - " NaN\n", - " NaN\n", " \n", " \n", " 1.3716000000\n", " 4.3912849426\n", " 46.6986503600\n", " NaN\n", - " NaN\n", - " NaN\n", " \n", " \n", " 1.5240000000\n", " 4.3912849426\n", " 46.6986503600\n", " NaN\n", - " NaN\n", - " NaN\n", " \n", " \n", " 1.6764000000\n", " 4.3912849426\n", " 46.6986503600\n", " NaN\n", - " NaN\n", - " NaN\n", " \n", " \n", " ...\n", @@ -385,88 +393,62 @@ " ...\n", " ...\n", " ...\n", - " ...\n", - " ...\n", " \n", " \n", " 303N764340060300\n", " 3387.5471999996\n", - " NaN\n", + " 303.7090000000\n", " 32.0276000039\n", - " NaN\n", - " 303.709\n", " 252.4951\n", " \n", " \n", " 3387.6995999996\n", - " NaN\n", + " 303.7090000000\n", " 32.0276000000\n", - " NaN\n", - " 303.709\n", " 252.4951\n", " \n", " \n", " 3387.8519999996\n", - " NaN\n", + " 303.7090000000\n", " 32.0276000000\n", - " NaN\n", - " 303.709\n", " 252.4951\n", " \n", " \n", " 3388.0043999996\n", - " NaN\n", + " 303.7090000000\n", " 32.0276000000\n", - " NaN\n", - " 303.709\n", " 252.4951\n", " \n", " \n", " 3388.1567999996\n", - " NaN\n", + " 303.7090000000\n", " 32.0276000000\n", - " NaN\n", - " 303.709\n", " 252.4951\n", " \n", " \n", "\n", - "

46594 rows × 5 columns

\n", + "

46594 rows × 3 columns

\n", "" ], "text/plain": [ - " HCAL GR DT CALI \\\n", - "UWI DEPT \n", - "Kennetcook #2 1.0668000000 4.3912849426 46.6986503600 NaN NaN \n", - " 1.2192000000 4.3912849426 46.6986503600 NaN NaN \n", - " 1.3716000000 4.3912849426 46.6986503600 NaN NaN \n", - " 1.5240000000 4.3912849426 46.6986503600 NaN NaN \n", - " 1.6764000000 4.3912849426 46.6986503600 NaN NaN \n", - "... ... ... .. ... \n", - "303N764340060300 3387.5471999996 NaN 32.0276000039 NaN 303.709 \n", - " 3387.6995999996 NaN 32.0276000000 NaN 303.709 \n", - " 3387.8519999996 NaN 32.0276000000 NaN 303.709 \n", - " 3388.0043999996 NaN 32.0276000000 NaN 303.709 \n", - " 3388.1567999996 NaN 32.0276000000 NaN 303.709 \n", - "\n", - " DT4P \n", - "UWI DEPT \n", - "Kennetcook #2 1.0668000000 NaN \n", - " 1.2192000000 NaN \n", - " 1.3716000000 NaN \n", - " 1.5240000000 NaN \n", - " 1.6764000000 NaN \n", - "... ... \n", - "303N764340060300 3387.5471999996 252.4951 \n", - " 3387.6995999996 252.4951 \n", - " 3387.8519999996 252.4951 \n", - " 3388.0043999996 252.4951 \n", - " 3388.1567999996 252.4951 \n", + " Caliper GR Sonic\n", + "UWI DEPT \n", + "Kennetcook #2 1.0668000000 4.3912849426 46.6986503600 NaN\n", + " 1.2192000000 4.3912849426 46.6986503600 NaN\n", + " 1.3716000000 4.3912849426 46.6986503600 NaN\n", + " 1.5240000000 4.3912849426 46.6986503600 NaN\n", + " 1.6764000000 4.3912849426 46.6986503600 NaN\n", + "... ... ... ...\n", + "303N764340060300 3387.5471999996 303.7090000000 32.0276000039 252.4951\n", + " 3387.6995999996 303.7090000000 32.0276000000 252.4951\n", + " 3387.8519999996 303.7090000000 32.0276000000 252.4951\n", + " 3388.0043999996 303.7090000000 32.0276000000 252.4951\n", + " 3388.1567999996 303.7090000000 32.0276000000 252.4951\n", "\n", - "[46594 rows x 5 columns]" + "[46594 rows x 3 columns]" ] }, - "execution_count": 10, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -474,7 +456,7 @@ "source": [ "keys = ['Caliper', 'GR', 'Sonic']\n", "\n", - "df = p.df(keys=keys, alias=alias)\n", + "df = p.df(keys=keys, alias=alias, rename_aliased=True)\n", "df" ] }, @@ -580,7 +562,7 @@ { "data": { "text/html": [ - "
IdxUWIDataPassingCaliper*GRSonic*SPRHOB
%3/3 wells3/3 wells3/3 wells2/3 wells3/3 wells
0Kennetcook #25/24 curves54HCAL

4.39 in
GR

78.99 gAPI
DT

63.08 us/ft
SP

52.47 mV
RHOB

2.61 g/cm3
1100/N14A/11E055/18 curves79CALI

8.90 in
GR

103.74 gAPI
DT

74.90 us/ft
SP

101.60 mV
RHOB

2.62 g/cm3
2303N7643400603004/22 curves78CALI

311.97 MM
GR

67.49 GAPI
DT4P

279.84 US/M

RHOB

2493.56 K/M3
" + "
IdxUWIDataPassingCaliper*GRSonic*SPRHOB
%3/3 wells3/3 wells3/3 wells2/3 wells3/3 wells
0Kennetcook #25/24 curves54HCAL

4.39 in
GR

78.99 gAPI
DT

63.08 us/ft
SP

52.47 mV
RHOB

2.61 g/cm3
1100/N14A/11E055/18 curves79CALI

8.90 in
GR

103.74 gAPI
DT

74.90 us/ft
SP

101.60 mV
RHOB

2.62 g/cm3
2303N7643400603004/22 curves78CALI

311.97 MM
GR

67.49 GAPI
DT4P

279.84 US/M

RHOB

2493.56 K/M3
" ], "text/plain": [ "" @@ -599,27 +581,6 @@ " )" ] }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'
IdxUWIDataPassingCaliper*GRSonic*SPRHOB
%3/3 wells3/3 wells3/3 wells2/3 wells3/3 wells
0Kennetcook #25/24 curves54HCAL

4.39 in
GR

78.99 gAPI
DT

63.08 us/ft
SP

52.47 mV
RHOB

2.61 g/cm3
1100/N14A/11E055/18 curves79CALI

8.90 in
GR

103.74 gAPI
DT

74.90 us/ft
SP

101.60 mV
RHOB

2.62 g/cm3
2303N7643400603004/22 curves78CALI

311.97 MM
GR

67.49 GAPI
DT4P

279.84 US/M

RHOB

2493.56 K/M3
'" - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "p.curve_table_html(keys=['Caliper', 'GR', 'Sonic', 'SP', 'RHOB'],\n", - " tests=tests, alias=alias)" - ] - }, { "cell_type": "markdown", "metadata": {}, diff --git a/docs/post_process_html.py b/docs/post_process_html.py index 72b44f6d..df9a3567 100644 --- a/docs/post_process_html.py +++ b/docs/post_process_html.py @@ -12,9 +12,9 @@ def simplify_credits(html): pattern = re.compile(s) html = pattern.sub(r'', html) - s = r'Copyright © 2022, Agile Scientific' + s = r'Copyright © 2022, The Welly Authors' pattern = re.compile(s) - new_s = '© 2022, Agile Scientific | CC BY' + new_s = '© 2022, The Welly Authors | CC BY' html = pattern.sub(new_s, html) return html diff --git a/tests/assets/barebones.las b/tests/assets/barebones.las new file mode 100644 index 00000000..316ad3df --- /dev/null +++ b/tests/assets/barebones.las @@ -0,0 +1,12 @@ +#----------------------------------------------------------------------------- +~CURVE INFORMATION +#MNEM.UNIT API CODE DESCRIPTION +#---- ----- -------- ----------------------- +DEPT .F :DEPTH (BOREHOLE) {F10.1} +#----------------------------------------------------------------------------- +# +# DEPT +# +~A + 200.0 + 201.0 \ No newline at end of file diff --git a/tests/assets/sample.las b/tests/assets/sample.las new file mode 100644 index 00000000..91cbc059 --- /dev/null +++ b/tests/assets/sample.las @@ -0,0 +1,46 @@ +~VERSION INFORMATION + VERS. 1.2: CWLS LOG ASCII STANDARD -VERSION 1.2 + WRAP. NO: ONE LINE PER DEPTH STEP +~WELL INFORMATION BLOCK +#MNEM.UNIT DATA TYPE INFORMATION +#--------- ------------- ------------------------------ + STRT.M 1670.000000: + STOP.M 1669.750000: + STEP.M -0.1250: + NULL. -999.2500: + COMP. COMPANY: # ANY OIL COMPANY LTD. + WELL. WELL: ANY ET AL OIL WELL #12 + FLD . FIELD: EDAM + LOC . LOCATION: A9-16-49-20W3M + PROV. PROVINCE: SASKATCHEWAN + SRVC. SERVICE COMPANY: ANY LOGGING COMPANY LTD. + DATE. LOG DATE: 25-DEC-1988 + UWI . UNIQUE WELL ID: 100091604920W300 +~CURVE INFORMATION +#MNEM.UNIT API CODE CURVE DESCRIPTION +#--------- ------------- ------------------------------ + DEPT.M : 1 DEPTH + DT .US/M : 2 SONIC TRANSIT TIME + RHOB.K/M3 : 3 BULK DENSITY + NPHI.V/V : 4 NEUTRON POROSITY + SFLU.OHMM : 5 RXO RESISTIVITY + SFLA.OHMM : 6 SHALLOW RESISTIVITY + ILM .OHMM : 7 MEDIUM RESISTIVITY + ILD .OHMM : 8 DEEP RESISTIVITY +~PARAMETER INFORMATION +#MNEM.UNIT VALUE DESCRIPTION +#--------- ------------- ------------------------------ + BHT .DEGC 35.5000: BOTTOM HOLE TEMPERATURE + BS .MM 200.0000: BIT SIZE + FD .K/M3 1000.0000: FLUID DENSITY + MATR. 0.0000: NEUTRON MATRIX(0=LIME,1=SAND,2=DOLO) + MDEN. 2710.0000: LOGGING MATRIX DENSITY + RMF .OHMM 0.2160: MUD FILTRATE RESISTIVITY + DFD .K/M3 1525.0000: DRILL FLUID DENSITY +~Other + Note: The logging tools became stuck at 625 meters causing the data + between 625 meters and 615 meters to be invalid. +~A DEPTH DT RHOB NPHI SFLU SFLA ILM ILD +1670.000 123.450 2550.000 0.450 123.450 123.450 110.200 105.600 +1669.875 123.450 2550.000 0.450 123.450 123.450 110.200 105.600 +1669.750 123.450 2550.000 0.450 123.450 123.450 110.200 105.600 diff --git a/tests/assets/sample_2.1.las b/tests/assets/sample_2.1.las new file mode 100644 index 00000000..9afa1697 --- /dev/null +++ b/tests/assets/sample_2.1.las @@ -0,0 +1,47 @@ +~VERSION INFORMATION + VERS. 2.1 : CWLS LOG ASCII STANDARD -VERSION 2.1 + WRAP. NO : ONE LINE PER DEPTH STEP +~WELL INFORMATION +#MNEM.UNIT DATA DESCRIPTION +#----- ----- ---------- ------------------------- +STRT .M 1670.0000 :START DEPTH +STOP .M 1669.7500 :STOP DEPTH +STEP .M -0.1250 :STEP +NULL . -999.25 :NULL VALUE +COMP . ANY OIL COMPANY INC. :COMPANY +WELL . AAAAA_2 :WELL +FLD . WILDCAT :FIELD +LOC . 12-34-12-34W5M :LOCATION +PROV . ALBERTA :PROVINCE +SRVC . ANY LOGGING COMPANY INC. :SERVICE COMPANY +DATE . 13-DEC-86 :LOG DATE +UWI . 100123401234W500 :UNIQUE WELL ID +~CURVE INFORMATION +#MNEM.UNIT API CODES CURVE DESCRIPTION +#------------------ ------------ ------------------------- + DEPT .M : 1 DEPTH + DT .US/M 60 520 32 00 : 2 SONIC TRANSIT TIME + RHOB .K/M3 45 350 01 00 : 3 BULK DENSITY + NPHI .V/V 42 890 00 00 : 4 NEUTRON POROSITY + SFLU .OHMM 07 220 04 00 : 5 SHALLOW RESISTIVITY + SFLA .OHMM 07 222 01 00 : 6 SHALLOW RESISTIVITY + ILM .OHMM 07 120 44 00 : 7 MEDIUM RESISTIVITY + ILD .OHMM 07 120 46 00 : 8 DEEP RESISTIVITY +~PARAMETER INFORMATION +#MNEM.UNIT VALUE DESCRIPTION +#-------------- ---------------- ----------------------------------------------- + MUD . GEL CHEM : MUD TYPE + BHT .DEGC 35.5000 : BOTTOM HOLE TEMPERATURE + BS .MM 200.0000 : BIT SIZE + FD .K/M3 1000.0000 : FLUID DENSITY + MATR . SAND : NEUTRON MATRIX + MDEN . 2710.0000 : LOGGING MATRIX DENSITY + RMF .OHMM 0.2160 : MUD FILTRATE RESISTIVITY + DFD .K/M3 1525.0000 : DRILL FLUID DENSITY +~OTHER + Note: The logging tools became stuck at 625 metres causing the data + between 625 metres and 615 metres to be invalid. +~A DEPTH DT RHOB NPHI SFLU SFLA ILM ILD +1670.000 123.450 2550.000 0.450 123.450 123.450 110.200 105.600 +1669.875 123.450 2550.000 0.450 123.450 123.450 110.200 105.600 +1669.750 123.450 2550.000 0.450 123.450 123.450 110.200 105.600