# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['moonpies']

package_data = \
{'': ['*']}

install_requires = \
['matplotlib>=3.3,<4.0',
 'numpy>=1.17,<2.0',
 'pandas>=1.0,<2.0',
 'scipy>=1.9.1,<2.0.0']

entry_points = \
{'console_scripts': ['moonpies = moonpies.cli:run']}

setup_kwargs = {
    'name': 'moonpies',
    'version': '1.0.1',
    'description': 'Moon Polar Ice and Ejecta Stratigraphy model',
    'long_description': '<div align="center">\n<a href="https://zenodo.org/badge/latestdoi/399214580">\n<img src="https://zenodo.org/badge/399214580.svg" alt="DOI"></a>\n<a href="https://github.com/psf/black">\n<img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code Style: Black" /></a>\n</div>\n\n# MoonPIES: Moon Polar Ice and Ejecta Stratigraphy\n\nWelcome to the *Moon Polar Ice and Ejecta Stratigraphy* (MoonPIES) model.\n\n**Note:** This model is not yet peer-reviewed and comes with no warranties. It should not be considered "stable". Ongoing work to improve the documentation and usability of the model may result in backwards-incompatible changes. Please direct bug reports or code feedback to the GitHub [issues board](https://github.com/cjtu/moonpies/issues) or general inquiries to Christian at [cjtu@nau.edu](mailto:cjtu@nau.edu).\n\n## Motivation\n\nMoonPIES models ice and ejecta at depth below lunar polar cold traps. With the imminent return of humans to the Moon through the NASA Artemis program, it is crucial to predict where we expect to find ice, a possibly invaluable lunar resource.\n\n## Installing MoonPIES\n\nThe easiest way to get MoonPIES is with pip:\n\n```python\npip install moonpies\n```\n\nIt is currently tested on Python version 3.8+ for Windows, OS X and Linux.\n\nTo install for development, you will require [Poetry](https://python-poetry.org/). Fork or clone this repository and then from the main moonpies folder, install the dev environment with:\n\n```python\npoetry install\n```\n\nThe environment can then be activated in the shell with `poetry shell` (see [poetry docs](https://python-poetry.org/docs/cli/) for more info).\n\n## Running the model\n\nThe MoonPIES model can be run directly from the terminal / command line with the `moonpies` command. Run `moonpies --help` for options.\n\n### Configuring a run\n\nMoonPIES functionality is easy to tweak by specifying any of its large list of input parameters (see documentation). A configuration file can be specified as a `.py` file containing a single dictionary. For example, to change the output directory of a run, create a file called `myconfig.py` containing:\n\n```python\n{\n    \'out_path\': \'~/Downloads/\'\n}\n```\n\nAnd supply the config file when running the model:\n\n```bash\nmoonpies --cfg myconfig.py\n```\n\nSee documentation for full list of parameters that can be supplied in a `config.py` file.\n\n### Random seeds\n\nMoonPIES is designed to be reproducable when given the same random seed and input parameters (on a compatible version). By default, MoonPIES will choose a random seed in [1, 99999]. Specify a particular seed with:\n\n```bash\nmoonpies 1958\n```\n\n### Outputs\n\nMoonPIES outputs are saved by today\'s date, the run name, and the random seed (e.g. `out/yymmdd/run/#####/`, where `#####` is the 5-digit random seed used. For example, a seed of 1958 will produce:\n\n```bash\nout/\n|- yymmdd/\n|  |- mpies/\n|  |  |- 01958/\n|  |  |  |- ej_columns_mpies.csv\n|  |  |  |- ice_columns_mpies.csv\n|  |  |  |- config_mpies.py\n|  |  |  |- strat_Amundsen.csv\n|  |  |  |- strat_Cabeus B.csv\n|  |  |  |- strat_Cabeus.csv\n|  |  |  |- ...\n```\n\nThe output directory will contain a `config_<run_name>.py` file which will reproduce the outputs if supplied as a config file to MoonPIES. Resulting stratigraphy columns for each cold trap are contained within the `strat_...` CSV files. Two additional CSVs with ejecta and ice columns over time show the raw model output (before outputs are collapsed into stratigraphic sequences).\n\n**Note:** Runs with the same run name and random seed will overwrite one another. When tweaking config parameters, remember to specify a new `run_name` to ensure a unique output directory.\n\n### Using MoonPIES in Python code\n\nMoonPIES can be run directly from Python by importing the `moonpies` module and calling the `main()` function:\n\n```Python\nimport moonpies\nmodel_out = moonpies.main()\n```\n\nTo specify custom configuration options, create a custom `Cfg` object provided by `config.py` and pass it to `moonpies.main()`. Any parameter in `config.Cfg()` can be set as an argument like so:\n\n```Python\nimport config\ncustom_cfg = config.Cfg(solar_wind_ice=False, out_path=\'~/Downloads\')\ncannon_model_out = moonpies.main(custom_cfg)\n```\n\nUnspecified arguments will retain their defaults. Consult the full API documentation for a description of all model parameters.\n\n### Note on versioning\n\nAs a Monte Carlo model, MoonPIES deals with random variation but is designed to be reproducible such that a particular random seed will produce the same set of random outcomes in the model. MoonPIES uses semantic versioning (e.g. major.minor.patch). Major version changes can include API-breaking changes, minor version changes will not break the API (but may break random seed reproducibility), while patch version change should preserve both the API and random seed reproducibility.\n\n## Monte Carlo method\n\nMoonPIES is a Monte Carlo model, meaning outputs can vary significantly from run to run. Therefore, MoonPIES should be run many times (with different random seeds) to build statistical confidence in the possible stratigraphy columns.\n\n### Running with gnuparallel (Linux/Mac/WSL only)\n\nTo quickly process many MoonPIES runs in parallel, one can use [GNU parallel](https://www.gnu.org/software/parallel/) which is available from many UNIX package managers, e.g.:\n\n```bash\napt install parallel  # Ubuntu / WSL\nbrew install parallel  # MacOS\n```\n\n**Note:** Not tested on Windows. On MacOS, requires homebrew first (see [brew.sh](https://brew.sh/)).\n\nNow, many iterations of the model may be run in parallel. To spawn 100 runs:\n\n`seq 100 | parallel -P-1 moonpies`\n\nThis example will start 1000 runs of MoonPIES, each with a unique random seed and output directory so that no data is overwritten. To configure your `parallel` runs:\n\n- The number of runs is given by the `seq N` parameter (for help see [seq](https://www.unix.com/man-page/osx/1/seq/)).\n- By default, `parallel` will use all available cores on your system. Specifying `-P-1` instructs GNU parallel to use all cores except one (`P-2` would use all cores except 2, etc).\n\n## Plotting outputs\n\n`MoonPIES` provides some functions to help visualize model outputs...\n\n*Coming soon!*\n\n## Authors\n\nThis model was produced by C. J. Tai Udovicic, K. Frizzell, K. Luchsinger, A. Madera, and T. Paladino with input from M. Kopp, M. Meier, R. Patterson, F. Wroblewski, G. Kodikara, and D. Kring.\n\n## License and Referencing\n\nThis code is made available under the [MIT license](https://choosealicense.com/licenses/mit/) which allows warranty-free use with proper citation. The model can be cited as:\n\n> Tai Udovicic et al. (2022). Moonpies. 10.5281/zenodo.7055800\n\nSee (CITATION.cff)[https://github.com/cjtu/moonpies/blob/main/CITATION.cff] or (MoonPIES on zenodo)[https://doi.org/10.5281/zenodo.7055799] for easy import to any reference manager.\n\n## Acknowledgements\n\nThis model was produced during the 2021 LPI Exploration Science Summer Intern Program which was supported by funding from the Lunar and Planetary Institute ([LPI](https://lpi.usra.edu)) and the Center for Lunar Science and Exploration ([CLSE](https://sservi.nasa.gov/?team=center-lunar-science-and-exploration)) node of the NASA Solar System Exploration Research Virtual Institute ([SSERVI](https://sservi.nasa.gov/)).\n',
    'author': 'Christian J. Tai Udovicic',
    'author_email': 'cjtu@nau.edu',
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://github.com/cjtu/moonpies',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'entry_points': entry_points,
    'python_requires': '>=3.8,<3.12',
}


setup(**setup_kwargs)
