Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some changes necessary for subsurface #118

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Leguark
Copy link

@Leguark Leguark commented Oct 6, 2020

From dict method

  • I have added a method to be able to pass directly a python dictionary. It is just a simplification of the method from_csv. Since I created the pull request someone else has created another from_dict method. I just renamed my contribution to from_dict_advance since it does more post processing.

I am using this in subsurface to be able to first read a table with pandas, clean it and then converting the pandas dataframe to a valid dictionary that striplog understands.

Supporting integer as formation name

  • At the moment any formation name that is passed as a integer is directly converted to float. This gave problems when the user uses ids for the formations and we want to map it to a table of the components.
  • In the same direction, comparing two Component objects with different integers was always comparing them as True.

This is the test that needs all of the mention here: https://github.com/softwareunderground/subsurface/blob/6543c9924dcfd5d67068069f2a6fc1f9e17f5ef5/tests/test_io/test_welly_to_subsurface.py#L420

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 76.815% when pulling 2d1b718 on Leguark:master into 02ae02e on agile-geoscience:master.

@coveralls
Copy link

coveralls commented Oct 6, 2020

Coverage Status

Coverage decreased (-0.3%) to 75.11% when pulling fcd7825 on Leguark:master into 0c68f63 on agile-geoscience:master.

@ThirstyGeo
Copy link

ThirstyGeo commented Mar 15, 2021

@Leguark I'm just getting to know the striplog and Markov Chain object preferences and wondering if you can suggest how you'd clean up a log in the form of a pandas table with well, top, base, log. Based on @kwinkunks notebook it looks like a .GroupBy or .to_json might be the way to go.

@ThirstyGeo
Copy link

Something like this, I suppose:
df.dropna(how='any').groupby('well')['log'].apply(lambda x: x.to_json(orient='records'))

@kwinkunks kwinkunks added this to To do in T21 Mar 30, 2021
… is just an lithology id). This casting

 makes impossible to map a table to integer properties
…y to fail.

This is necessary to be able to use table when the lithologies are given by id (int) instead by name (string)
@Leguark Leguark changed the title - Added from_dict method Some changes necessary for subsurface May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
T21
To do
Development

Successfully merging this pull request may close these issues.

None yet

3 participants