Add support for command line scripts

This commit is contained in:
wiltbemj
2024-06-21 09:23:49 -04:00
parent 66d7c3d2aa
commit a4fb1e850d
6 changed files with 138 additions and 2 deletions

View File

@@ -13,6 +13,7 @@
import os
import sys
sys.path.insert(0, os.path.abspath('../../kaipy'))
sys.path.insert(1, os.path.abspath('../../kaipy/scripts/quicklook'))
# -- Project information -----------------------------------------------------
@@ -33,6 +34,7 @@ release = '1.0.0'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinxcontrib.autoprogram',
'sphinx_rtd_theme'
]

View File

@@ -5,12 +5,16 @@
Kaipy documentation!
=================================
`kaipy` is a Python package for supporting the running and analysis of the Mutliscale Atmosphere Geospace Environment (MAGE) Model developed by the Center for Geospace Storms.
.. toctree::
:maxdepth: 2
:caption: Contents:
:caption: Kaipy:
intro
kaipy/installation
kaipy/requirements
kaipy/usage
scripts
modules

View File

@@ -0,0 +1,81 @@
Installation
============
Custom
------
Conda Installation
~~~~~~~~~~~~~~~~~~~
1. Download Miniconda Installer
- Visit the `Miniconda Downloads <https://docs.conda.io/en/latest/miniconda.html>`_ page.
- Select the Linux installer for Python 2.x or 3.x as per your requirements.
2. Open a Terminal
- Open a terminal window on Linux by pressing ``Ctrl + Alt + T``, or search for "Terminal" in the applications menu.
3. Navigate to Download Directory
.. code-block:: bash
cd ~/Downloads
Change to the directory where the installer was downloaded, usually the ``Downloads`` directory.
4. Make the Installer Executable
- Make the downloaded script executable. Replace ``Miniconda3-latest-Linux-x86_64.sh`` with the actual downloaded file name.
.. code-block:: bash
chmod +x Miniconda3-latest-Linux-x86_64.sh
5. Run the Installer
- Execute the installer script and follow the on-screen instructions.
.. code-block:: bash
./Miniconda3-latest-Linux-x86_64.sh
- You'll need to approve the license agreement and choose the installation location.
6. Initialize Conda
- After installation, initialize Miniconda to add Conda to your PATH.
7. Close and Reopen Your Terminal
- To apply the changes, close and reopen your terminal window.
Creating Environment
~~~~~~~~~~~~~~~~~~~~~
Create python 3.8 environment
.. note::
The name of the conda environment in this example is ``kaipy``.
.. code-block:: bash
conda create --name kaipy python=3.8
Installing kaipy
~~~~~~~~~~~~~~~~~~~
.. warning::
cartopy requires geos which doesn't install properly via the pip install. Use the command below if you face the issue.
.. code-block:: bash
conda install -c conda-forge cartopy
To install tiegcmpy, run the following command:
.. code-block:: bash
pip install kaipy

View File

@@ -0,0 +1,22 @@
Requirements
============
kaipy requires:
- alive_progress
- astropy
- cartopy
- cdasws
- configparser
- h5py
- jupyterlab
- matplotlib
- pandas
- progressbar
- pyhdf
- pyspedas
- pytest
- slack_sdk
- spacepy
- sphinx-rtd-theme
- sunpy

View File

@@ -0,0 +1,16 @@
Usage
=====
kaipy can be run in two modes: API and via series scripts.
Mode: API
---------
Loading datasets
~~~~~~~~~~~~~~~~
Info on loading datasets here
Plots
~~~~~
Info on plots here

11
docs/source/scripts.rst Normal file
View File

@@ -0,0 +1,11 @@
Kaipy scripts
================
.. autoprogram:: cli:parser
:prog: cli.py
.. autoprogram:: swpic:parser
:prog: swpic.py
.. autoprogram:: msphpic:create_command_line_parser()
:prog: msphpic.py