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

packages = \
['smos_walker',
 'smos_walker.api',
 'smos_walker.cli',
 'smos_walker.core',
 'smos_walker.data_reader',
 'smos_walker.node_to_ndarray',
 'smos_walker.remote',
 'smos_walker.typesystem_dynamic_decorator',
 'smos_walker.typesystem_parser',
 'smos_walker.typesystem_static_decorator',
 'smos_walker.xml_reader']

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

install_requires = \
['lxml>=4.9.2,<5.0.0',
 'numpy>=1.24.2,<2.0.0',
 'tqdm>=4.65.0,<5.0.0',
 'typing-extensions>=4.5.0,<5.0.0',
 'xmlschema>=2.2.0,<3.0.0']

setup_kwargs = {
    'name': 'smos-walker',
    'version': '0.5.0',
    'description': '',
    'long_description': '# smos-walker\n\n![Tests GitHub Badge](https://github.com/ARGANS/smos-walker/actions/workflows/tests.yml/badge.svg)\n\n![picture 5](docs/assets/images/e3480009db827ddb27df83dee0c08a3b45dd2237b289da23957b653d7bb2e747.jpg)\n\n_Anakin Skywalker on a satellite_\n\n## Table of Contents\n\n- [smos-walker](#smos-walker)\n  - [Table of Contents](#table-of-contents)\n  - [Description](#description)\n  - [Architecture](#architecture)\n  - [Terminology](#terminology)\n  - [Documentation](#documentation)\n  - [Installation](#installation)\n    - [Code](#code)\n      - [With Poetry](#with-poetry)\n      - [With Git](#with-git)\n    - [Test data](#test-data)\n  - [Usage](#usage)\n    - [With `ipython`](#with-ipython)\n    - [With bash](#with-bash)\n      - [Tree](#tree)\n  - [Development](#development)\n    - [Testing](#testing)\n      - [Manual testing](#manual-testing)\n      - [Run all tests](#run-all-tests)\n      - [Filter tests by pattern](#filter-tests-by-pattern)\n      - [Run a coverage check](#run-a-coverage-check)\n      - [Tool: generate all human readable trees resulting from the static analysis of schemas](#tool-generate-all-human-readable-trees-resulting-from-the-static-analysis-of-schemas)\n    - [Code Quality](#code-quality)\n      - [Lint the code with `pylint`](#lint-the-code-with-pylint)\n      - [Lint the code with `flake8`](#lint-the-code-with-flake8)\n      - [Verify types with `mypy`](#verify-types-with-mypy)\n      - [Prune unused imports with `pautoflage`](#prune-unused-imports-with-pautoflage)\n      - [Run `tox`](#run-tox)\n      - [Verify that the documentation build does not raise warnings](#verify-that-the-documentation-build-does-not-raise-warnings)\n    - [Bump version](#bump-version)\n    - [Misc](#misc)\n      - [Fixing `unrecognized option found: source-root vscode` in VSCode](#fixing-unrecognized-option-found-source-root-vscode-in-vscode)\n  - [Misc](#misc-1)\n\n## Description\n\nThe _SMOS walker_ aims to facilitate the read of `.DBL` (datablock) binary files that are using the Earth Explorer format. These types of files are notably used in the SMOS project. Then, a datablock can be converted to a numpy ndarray structure for further processing. Using numpy open the field for high-level operation over the data. The tool can also be used to get user-friendly representation of the cumbersome XML schemas\n\n## Architecture\n\n![Architecture Overview](docs/assets/images/baa0be64a96954f434a2859c3a9ec2de5dd08bd4f1e70cd61a45a4a6dd5f5200.png)\n\n_Architecture Overview_\n\n## Terminology\n\n-   DBL = Data Block\n-   HDR = Header\n\n## Documentation\n\n:information_source: The current documentation contains the reference for the project\'s API. Use it if you want to get precise and detailed information about the machinery behind the project. For a quick start, you should rather read the [Usage](#usage) section\n\nTo access the documentation online, go to https://argans.github.io/smos-walker/reference/\n\nThe documentation can be build then deployed on GitHub Pages (via a GitHub Action under the hood) with:\n\n```bash\npoetry run mkdocs build\npoetry run mkdocs gh-deploy\n```\n\nTo serve the documentation on your machine, run:\n\n```bash\npoetry run mkdocs serve\n```\n\nThe documentation will be available on http://127.0.0.1:7099/\n\n:information_source: It is planned to have the documentation deployed on GitHub Pages later on.\n\n## Installation\n\n### Code\n\n#### With Poetry\n\nYou can add `smos-walker` in your project as a Poetry git dependency.\n\nWith a specific version tag:\n\n```bash\npoetry add git+ssh://git@github.com:ARGANS/smos-walker.git#0.5.0\n```\n\nWith a specific branch (`master` contains the latest changes)\n\n```bash\npoetry add git+ssh://git@github.com:ARGANS/smos-walker.git#master\n```\n\nSee [Poetry documentation about `add`](https://python-poetry.org/docs/cli/#add) for more information.\n\nYou can then import `smos_walker` in your project:\n\n```python\nfrom smos_walker import SmosWalker\n```\n\n#### With Git\n\nYou can also clone directly this repository. It can be useful if you want to contribute.\n\n```bash\ngit clone git@github.com:ARGANS/smos-walker.git\n```\n\nThen run inside the repository:\n\n```bash\npoetry install\n```\n\nFor more information about commands you can execute in the project, please refer to the [Development](#development) section.\n\n### Test data\n\nPlease refer to the [Testing](#testing)] section\n\n## Usage\n\n### With `ipython`\n\nThe main goal of using the project as an imported python package is to provide help exploring DBL files, for instance in a Jupyter notebook.\n\n```bash\npoetry run ipython\n```\n\nIf you want to manually instantiate a walker, import the class directly\n\n```python\nfrom smos_walker import SmosWalker\nfrom pathlib import Path\n\n# Change these variables according to your needs\nroot = Path(r"D:\\Profils\\eschalk\\dev\\argans\\projects\\python\\smos-walker\\smos-walker\\tests\\resources\\FILLME")\nschemas = root / r"schemas_2022-09-01_v07-08-04\\schemas_2022-09-01_v07-08-04\\schemas_2022-09-01_v07-08-04"\n\nxsd_path = schemas / "binx/binx.xsd"\nxml_schema_path = schemas / "AUX_/DTBXY_/DBL_SM_XXXX_AUX_DTBXY__0403.binXschema.xml"\ndatablock_folder_path = root / "SM_REPR_AUX_DTBXY__20160101T004254_20160101T013614_699_200_1"\n\n# Instantiate a walker\nw = SmosWalker(xsd_path, xml_schema_path, datablock_folder_path)\n\n# Print general information about a walker\nw\n\n# Don\'t forget to use the ipython\'s autocompletion feature when using the walker to learn how to use it\n\n# Paths in the datablock\nw.paths\n\n# Query the datablock ans describe the numpy dtype\n\nregions = w.query("/Data_Block/List_of_Regions")\nregions.dtype.descr\n\nsnapshots = w.query("/Data_Block/List_of_Snapshots")\nsnapshots.dtype.descr\n\nnumpy_array_measurements = w.query("/Data_Block/List_of_Grid_Points/List_of_Measurements")\nnumpy_array_measurements.dtype.descr\n\n# Use Numpy API to access the details\nregions["List_of_Models"][0]["List_of_OTT_Data"][2][7]["List_of_stats"][11]["mean"]\n\nimport numpy as np\n\nnp.mean(regions["List_of_Models"]["List_of_OTT_Data"]["List_of_stats"]["mean"])\n\nnp.mean(regions["List_of_Models"][0]["List_of_OTT_Data"][2][7]["List_of_stats"]["mean"])\n```\n\nSee `test_smoswalker_highlevel_api_dtbxy_` and `test_smoswalker_highlevel_api_vtec_c` for other examples of usages of the `SmosWalker` class\n\nSee `test_from_earthexplorer` for an alternate (and more concise) way to instantiate a `SmosWalker` instance,\nby only providing a path to a folder containing all XML schemas, and a path pointing toward a EarthExplorer folder.\n\n### With bash\n\n⚠️ This method is **NOT** recommended. It is recommended to use ipython instead\n\nThe main goal of using the project with bash is to print human representations of the resulting analysis of the various XML schemas.\n\n#### Tree\n\nRun the script: See the example inside `launch.dev.eschalk.sh`\n\n`STEP_LEVEL` corresponds to the step levels displayed on the overview schema of the app.\n\n## Development\n\n### Testing\n\nFill the folder `tests/resources/FILLME` with schemas and the example DBL files.\n\n▶️ [DOWNLOAD LINK: FILLME_resources_for_smos_walker_tests.zip](https://acricwe-my.sharepoint.com/:u:/g/personal/eschalk_argans_eu/EROHzUkMeBBPth_uS2gHxFcBRHhdiUgAD3d7blbU4rytzg?e=b3mn8b) ◀️\n\n#### Manual testing\n\nIt can be nice to manually test and get a quick feedback before writing code using the library, in order to get used to it.\n\nYou can try out the example files with:\n\n```python\nfrom tests.utilities import instantiate_smos_walkers\n\n# Instantiate walkers for all available test data...\nwalkers = instantiate_smos_walkers()\n\n# Example output: dict_keys([\'DTBXY_\', \'VTEC_C\', \'SCSF1C\', \'OSUDP2\', \'AFWD1A\', \'DNBSLC\'])\nwalkers.keys()\n\n# Access one of the walkers\nwalker = walkers[\'DTBXY_\']\n\n# ...Or only load the walker you want to use\nw = instantiate_smos_walkers(\'DTBXY_\')\n\n# Print general info about the walker\nw\n```\n\nSee the previous [Usage](#usage) section for more details about how to manipulate the walker.\n\n#### Run all tests\n\n```bash\npoetry run pytest\n```\n\n#### Filter tests by pattern\n\n```bash\npoetry run pytest -k test_index_datablock_dtbxy_with_query_wrapper\n```\n\n#### Run a coverage check\n\nNote: tests will run slower, but a report will be generated\n\n```bash\npoetry run pytest --cov=smos_walker # Coverage check, slower\n```\n\nGenerate an HTML report, showing more insight regarding checked branches in the code\n\n```bash\npoetry run pytest --cov=smos_walker --cov-report html\n```\n\n#### Tool: generate all human readable trees resulting from the static analysis of schemas\n\n```bash\npoetry run pytest --runslow -k test_static_decorator_on_all_schemas\n```\n\nAll schemas will be dumped into `tests/generated/test_static_decorator_on_all_schemas/`\n\n### Code Quality\n\n#### Lint the code with `pylint`\n\n```bash\npoetry run pylint smos_walker\n```\n\n#### Lint the code with `flake8`\n\n```bash\npoetry run flake8 smos_walker\n```\n\n#### Verify types with `mypy`\n\n```bash\npoetry run mypy smos_walker\n```\n\n#### Prune unused imports with `pautoflage`\n\n```bash\npoetry run pautoflake .\n```\n\n#### Run `tox`\n\nMost useful in a CI environment.\n\n```bash\npoetry run tox\n```\n\n#### Verify that the documentation build does not raise warnings\n\n```bash\npoetry run mkdocs serve\n```\n\n### Bump version\n\nTo bump the version:\n\n-   Update version in `pyproject.toml`\n-   Update version in `smos_walker/__init__.py`\n-   Update version in this README file\n\nNote: This process is definetely boilerplate and can be improved.\n\n### Misc\n\n#### Fixing `unrecognized option found: source-root vscode` in VSCode\n\n> Add `--disable=E0015` argument to the Python "Pylint Args" configuration.\n\nSee https://stackoverflow.com/questions/72478704/how-to-fix-pylint-unrecognized-option-error-in-vs-code\n\n## Misc\n\nNote: A better name could be `enekin-smoswalker` (the two substituded As for Es meaning Earth Explorer).\n\nInformation on SMOS data: `A database of 12 years * 28 per day (DataBlocks)`\n',
    'author': 'Etienne Schalk',
    'author_email': 'eschalk@argans.eu',
    'maintainer': 'None',
    'maintainer_email': 'None',
    'url': 'None',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.10,<4.0',
}


setup(**setup_kwargs)
