Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add setup script #2

Merged
merged 2 commits into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 133 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Created by .ignore support plugin (hsz.mobi)
### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

.idea
2 changes: 0 additions & 2 deletions __init__.py

This file was deleted.

Binary file removed __pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file removed __pycache__/core.cpython-37.pyc
Binary file not shown.
262 changes: 0 additions & 262 deletions notebooks/.ipynb_checkpoints/Read GrADS ctl file Chn-checkpoint.ipynb

This file was deleted.

46 changes: 46 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
from setuptools import setup, find_packages
import codecs
from os import path
import io
import re

with io.open("xgrads/__init__.py", "rt", encoding="utf8") as f:
version = re.search(r'__version__ = "(.*?)"', f.read()).group(1)

here = path.abspath(path.dirname(__file__))

with codecs.open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()

setup(
name='xgrads',

version=version,

description='Parse and read ctl file commonly used by GrADS.',
long_description=long_description,
long_description_content_type='text/markdown',

url='https://github.com/miniufo/xgrads',

author='miniufo',
author_email='[email protected]',

license='MIT',

classifiers=[
'OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7'
],

keywords='grads xarray dask',

packages=find_packages(exclude=['docs', 'tests', "ctls", "notebooks", "pics"]),

install_requires=[
"numpy",
"xarray",
"dask",
],
)
3 changes: 3 additions & 0 deletions xgrads/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from .core import CtlDescriptor, open_CtlDataset
__version__ = "0.1.0"
2 changes: 1 addition & 1 deletion core.py → xgrads/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1048,5 +1048,5 @@ def __read_continuous(file, offset=0, shape=None, dtype='<f4', use_mmap=True):
print(CtlDescriptor(content=content))

for i in range(6):
print(CtlDescriptor(file='./ctls/test'+str(i+1)+'.ctl'))
print(CtlDescriptor(file='../ctls/test'+str(i+1)+'.ctl'))
print('\n')