Commit 76a1e2cb authored by Qusai Al Shidi's avatar Qusai Al Shidi
Browse files

Documentation fixes

parent 1a7f0c79
......@@ -33,11 +33,13 @@ def replace_command(parameters, input_file, output_file='PARAM.in'):
TypeError: If a value given couldn't be converted to string.
Examples:
```
```python
change['#SOLARWINDFILE'] = [['T', 'UseSolarWindFile'],
['new_imf.dat', 'NameSolarWindFile']]
# This will overwrite PARAM.in
swmfpy.paramin.replace('PARAM.in.template', change)
```
"""
# Author: Qusai Al Shidi
......@@ -94,11 +96,15 @@ def read_command(command, paramin_file='PARAM.in', **kwargs):
ValueError: When the #COMMAND is not found.
Examples:
```python
start_time = swmfpy.paramin.read_command('#STARTTIME')
end_time = swmfpy.paramin.read_command('#ENDTIME')
print('Starting month is ', start_time[1])
print('Ending month is ', end_time[1])
```
This will treat all following lines as values for the command. To suppress
this, try using the `num_of_values` keyword. This is helpful if your
PARAM.in is comment heavy.
......@@ -143,7 +149,7 @@ def _make_line(value):
"""Makes the paramin line based on value type recursively"""
if isinstance(value, str):
return value
elif isinstance(value, list):
if isinstance(value, list):
return '\t\t\t'.join([_make_line(v) for v in value])
return str(value)
......
......@@ -31,6 +31,7 @@ def get_omni_data(time_from, time_to, **kwargs):
Examples:
```python
import datetime
import swmfpy.web
......@@ -138,7 +139,7 @@ def _check_bad_omni_num(value_string):
def download_magnetogram_adapt(time, map_type='fixed', **kwargs):
'''This routine downloads GONG ADAPT magnetograms.
"""This routine downloads GONG ADAPT magnetograms.
Downloads ADAPT magnetograms from ftp://gong2.nso.edu/adapt/maps/gong/
to a local directory. It will download all maps with the regex file
......@@ -165,6 +166,7 @@ def download_magnetogram_adapt(time, map_type='fixed', **kwargs):
Examples:
```python
import datetime as dt
# Use datetime objects for the time
......@@ -173,7 +175,7 @@ def download_magnetogram_adapt(time, map_type='fixed', **kwargs):
map_type='central',
download_dir='./mymaps/')
```
'''
"""
# Author: Zhenguang Huang
# Email: zghuang@umich.edu
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment