Skip to content

Commit

Permalink
Avoid non-unique saturation
Browse files Browse the repository at this point in the history
  • Loading branch information
alifbe committed Sep 18, 2024
1 parent 4162b12 commit f970719
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/pyscal/gasoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def __init__(
)
sg_list.sort()
self.table = pd.DataFrame(sg_list, columns=["SG"])
self.table["sgint"] = list(map(round, self.table["SG"] * SWINTEGERS))
self.table["sgint"] = list(map(round, self.table["SG"] * SWINTEGERS * 10))
self.table = self.table.drop_duplicates("sgint")

# Now sg=1-sorg-swl might be accidentally dropped, so make sure we
Expand Down
2 changes: 1 addition & 1 deletion src/pyscal/wateroil.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def __init__(

# Ensure that we do not have sw values that are too close
# to each other, determined rougly by the distance 1/10000
self.table["swint"] = list(map(round, self.table["SW"] * SWINTEGERS))
self.table["swint"] = list(map(round, self.table["SW"] * SWINTEGERS * 10))
self.table = self.table.drop_duplicates("swint")

# Now, sw=1-sorw might be accidentaly dropped, so make sure we
Expand Down
2 changes: 1 addition & 1 deletion src/pyscal/wateroilgas.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def SOF3(self, header: bool = True, dataincommentrow: bool = True) -> str:
.bfill()
.reset_index()
)
sof3table["soint"] = list(map(round, sof3table["SO"] * SWINTEGERS))
sof3table["soint"] = list(map(round, sof3table["SO"] * SWINTEGERS * 10))
sof3table = sof3table.drop_duplicates("soint")

# The 'so' column has been calculated from floating point numbers
Expand Down

0 comments on commit f970719

Please sign in to comment.