You are on page 1of 7

Batch variable unit assignment using python script in Techlog

Contents

• Problem Statement
Introduction
• Solution
Solution
• Workflow
Workflow
• Limitation
Result
Introduction

• Techlog data harmonization tool may be used to change/convert units for variables
• However, for the case of multiple variable unit assignment, the workflow can be simplified by
using python scripts
• The python script reads an input CSV file and batch changes/converts the variable units in the
project
Solution

• The python script takes an input of a .csv file with the input fields: Variable, Unit_before and
Unit_after
• The following steps are carried out by the script:
• Read the CSV file
• Check if the Unit_before is NULL, change the unit directly
• Check if Unit_before and Unit_after are compatible and convert the units if required
Workflow

1. Open the .csv file and enter the fields Variable, Unit_before and Unit_after

2. Open the script within Techlog


3. Enter the file path to the .csv file

4. Filter the wells and datasets of interest


5. Run the script from the launch button
Caution!

• The variable units that are empty need to be specified as NULL


• Once changed, the units cannot be reassigned to empty using the python script
Result

Before After
Well 1 Well 1

Well 2 Well 2

Well 3 Well 3

You might also like