Skip to content

Commit

Permalink
Fix docs for pydantic 2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
larsevj committed Sep 10, 2024
1 parent 4677589 commit 71b3d90
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 40 deletions.
11 changes: 8 additions & 3 deletions src/semeio/_docs_utils/_json_schema_2_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@
from typing import List, Optional, Union


def _insert_ref(schema: dict, defs: dict) -> None:
for value in schema.values():
def _insert_ref(schema: dict, defs: dict) -> dict:
schema_copy = schema.copy()
for index, value in schema_copy.items():
if isinstance(value, dict):
_insert_ref(value, defs)
schema[index] = _insert_ref(value, defs)
elif isinstance(value, list):
for index, val in enumerate(value.copy()):
if isinstance(val, int):
val = str(val)
if "$ref" in val:
value[index] = defs[val["$ref"]].pop("properties")
elif index == "$ref":
del schema["$ref"]
schema["must be"] = defs[value].pop("properties")
return schema


def _remove_key(schema: dict, del_key: str) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,75 +125,82 @@

**must be**:

**ts_simple**:
Simple TimeShift geertsma algorithm. It assumes a constant velocity and is fast
**ts_simple**:

Simple TimeShift geertsma algorithm. It assumes a constant velocity and is fast

**items**:

**items**:

**items**:
**format**: date

**format**: date
**type**: string

**type**: string
**type**: array

**type**: array
**minimum length**: 2

**minimum length**: 2
**maximum length**: 2

**maximum length**: 2
**type**: array

**type**: array
**ts**:
TimeShift geertsma algorithm, which uses velocity, very slow
**ts**:

TimeShift geertsma algorithm, which uses velocity, very slow

**items**:

**items**:

**items**:
**format**: date

**format**: date
**type**: string

**type**: string
**type**: array

**type**: array
**minimum length**: 2

**minimum length**: 2
**maximum length**: 2

**maximum length**: 2
**type**: array

**type**: array
**ts_rporv**:
Delta pressure multiplied by cell volume, relatively fast
**ts_rporv**:

Delta pressure multiplied by cell volume, relatively fast

**items**:

**items**:

**items**:
**format**: date

**format**: date
**type**: string

**type**: string
**type**: array

**type**: array
**minimum length**: 2

**minimum length**: 2
**maximum length**: 2

**maximum length**: 2
**type**: array

**type**: array
**dpv**:
Calculates timeshift without using velocity. The velocity is only used to get the surface on the velocity grid. It uses a change in porevolume from Eclipse (RPORV in .UNRST) as input to Geertsma model.
**dpv**:

**items**:
Calculates timeshift without using velocity. The velocity is only used to get the surface on the velocity grid. It uses a change in porevolume from Eclipse (RPORV in .UNRST) as input to Geertsma model.

**items**:

**items**:
**items**:

**format**: date
**format**: date

**type**: string
**type**: string

**type**: array
**type**: array

**minimum length**: 2
**minimum length**: 2

**maximum length**: 2
**maximum length**: 2

**type**: array
**type**: array

0 comments on commit 71b3d90

Please sign in to comment.