Commit 7a4e7d22 authored by Qusai Al Shidi's avatar Qusai Al Shidi 💬
Browse files

Made dependency handling more clear.

parent 2d6c838a
......@@ -46,11 +46,15 @@ def my_new_func(some_args):
Dependencies
------------
If your code has dependencies that is large and uncommon (e.g. SpacePy) then please seperate it as it's own module. For example you may create a folder:
If your code has dependencies that is large and uncommon (e.g. SpacePy) then please import it in the function and be explicit about the dependencies. For example you may create a function:
```bash
mkdir swmfpy/spacepy
touch swmfpy/__init__.py
```python
def func_with_dependency():
"""Func does this.
Depends on spacepy. Try `pip install -U spacepy`
"""
# Function body
```
Then your functions will be in swmfpy.spacepy which has its own namespace.
......
......@@ -142,6 +142,9 @@ def download_magnetogram_adapt(time, map_type='fixed', **kwargs):
download_dir (str): (default is current dir) Relative directory
where you want the maps to be downloaded.
Returns:
str: First unzipped filename found.
Raises:
NotADirectoryError: If the adapt maps directory
is not found on the server.
......@@ -230,3 +233,9 @@ def download_magnetogram_adapt(time, map_type='fixed', **kwargs):
# close the connection
ftp.quit()
# return first file name if all goes well
return_name = filenames[0]
if '.gz' in return_name:
return_name = return_name[:-3]
return return_name
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