Building and Publishing Python-based Flows
Danomics Flows let users write their own tools using Python. These tools can vary from simple scripts to calculate a property to complex tools with several user options.
Python tools can be published, which makes them appear as if they are native tools in Danomics and makes them available to coworkers that are in the same organization.
Note: Many of Danomicsbuilt-in Flow tools are written in Python (e.g., NullRepeatedLogSamples and the machine learning tools Train and Predict). The code for these is user visible and can be used as a reference when writing your own tools.
Publishing a Python Flow Tool
When building Flows it is relatively common to use a Python tool to process data. In many cases these tools are useful to others in your company and you would like to make it broadly available to them. Let’s consider an example Flow tool that calculates the clay volume from gamma ray, with user options for the clean and clay parameters (in reality you would be far better served doing this in the CPI, but this is a useful illustration of the different components involved).
Once we are done, the final tool will look like this:
The code that generates this is as follows:
For the purposes of publishing the Python tool, the key part is the “name:” field provided in the tool definition. This name should be unique. To share the tool with other users click on the icon to the right of the Code tab. This opens a dialogue to “Save as tool”.
Once the tool has been published it will show up in the Flow tools folder in the File Navigation menu on the left hand side. When added to a flow it will now appear with its name as shown here.
Use Cases
We have seen companies apply custom built Python tools in a number of ways. Here are some examples:
- Using Python to deploy machine learning models developed by in-house data science and software teams.
- Performing custom curve renaming and unit conversions based on company's internal standards for archiving data.
- Performing proprietary calculations for operations such as log cleanup or petrophysical calculations.
The ability to publish tools within an organization enables companies to take their work out of R&D and put it into the hands of users. Contact us to learn more.
Related Insights
DCA: Type well curves
In this video I demonstrate how to generate a well set filtered by a number of criteria and generate a multi-well type curve. Before starting this video you should already know how to load your data and create a DCA project. If not, please review those videos. Type well curves are generated by creating a decline that represents data from multiple wells.
DCA: Loading Production data
In this video I demonstrate how to load production and well header data for use in a decline curve analysis project. The first step is to gather your data. You’ll need: Production data – this can be in CSV, Excel, or IHS 298 formats. For spreadsheet formats you’ll need columns for API, Date, Oil, Gas, Water (optional), and days of production for that period (optional). Well header data – this can be in CSV, Excel, or IHS 297 formats.
Sample data to get started
Need some sample data to get started? The files below are from data made public by the Wyoming Oil and Gas Commission. These will allow you to get started with petrophysics, mapping, and decline curve analysis. Well header data Formation tops data Deviation survey data Well log data (las files) Production data (csv) or (excel) Wyoming counties shapefile and projection Wyoming townships shapefile and projection Haven’t found the help guide that you are looking for?