Skip to content

Commit

Permalink
Cosmetic changes to docstrings for sphinx
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnymaserati committed Dec 16, 2023
1 parent 95ee04c commit 5f8dfe7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
36 changes: 17 additions & 19 deletions welleng/survey.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def __init__(self, projection: str = "EPSG:23031") -> None:
The EPSG code of the map of interest. The default represents
ED50/UTM zone 31N.
Reference
---------
References
----------
For codes refer to [EPSG](https://epsg.io).
"""
self.crs = CRS(projection)
Expand Down Expand Up @@ -117,33 +117,31 @@ def get_factors_from_x_y(
date:
The date used for determining the magnetic parameters.
Example
-------
Examples
--------
In the following example, the parameters for Den Haag in The
Netherlands are looked up with the reference map ED50 UTM Zone 31N.
```python
>>> import pprint
>>> from welleng.survey import SurveyParameters
>>> calculator = SurveyParameters('EPSG:23031')
>>> survey_parameters = calculator.get_factors_from_x_y(
... x=588319.02, y=5770571.03
... )
>>> pprint(survey_parameters)
... {'convergence': 1.01664403471959,
... 'date': '2023-12-16',
... 'declination': 2.213,
... 'dip': -67.199,
... 'easting': 588319.02,
... 'latitude': 52.077583926214494,
... 'longitude': 4.288694821453205,
... 'magnetic_field_intensity': 49381,
... 'northing': 5770571.03,
... 'scale_factor': 0.9996957469340414,
... 'srs': 'EPSG:23031',
... 'x': 588319.02,
... 'y': 5770571.03}
```
{'convergence': 1.01664403471959,
'date': '2023-12-16',
'declination': 2.213,
'dip': -67.199,
'easting': 588319.02,
'latitude': 52.077583926214494,
'longitude': 4.288694821453205,
'magnetic_field_intensity': 49381,
'northing': 5770571.03,
'scale_factor': 0.9996957469340414,
'srs': 'EPSG:23031',
'x': 588319.02,
'y': 5770571.03}
"""
longitude, latitude = self(x, y, inverse=True)
result = self.get_factors(longitude, latitude)
Expand Down
6 changes: 2 additions & 4 deletions welleng/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,12 +665,11 @@ def annular_volume(od: float, id: float = None, length: float = None):
annular_volume: float
The (unit) volume of the annulus or cylinder.
Example
Examples
-------
In the following example we calculate annular volume along a 1,000 meter
section length of 9 5/8" casing inside 12 1/4" hole.
```python
>>> from welleng.utils import annular_volume
>>> from welleng.units import ureg
>>> av = annular_volume(
Expand All @@ -679,8 +678,7 @@ def annular_volume(od: float, id: float = None, length: float = None):
... length=ureg('1000 meter')
... )
>>> print(av)
... 3.491531223156194 meter ** 3
```
3.491531223156194 meter ** 3
"""
length = 1 if length is None else length
id = 0 if id is None else id
Expand Down

0 comments on commit 5f8dfe7

Please sign in to comment.