Skip to content

Commit 2300ee0

Browse files
author
Jeff Whitaker
committed
Merge pull request #409 from matthew-brett/refactor-package-structure
MRG: refactor modules into netCDF4 package
2 parents 4363fdb + eeb504f commit 2300ee0

File tree

18 files changed

+4906
-4882
lines changed

18 files changed

+4906
-4882
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
build/
2+
*.pyc
3+
dist/
4+
*.egg-info/

Changelog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
Not installed by setup.py (contributed by Ross Gammon, issue #383).
2828
* replace tabs with spaces by running reindent.py on all *.py and *.pyx files
2929
(issue #378).
30+
* refactor netCDF4_utils and netCDF4 module into netCDF4 package.
31+
Refactoring effectively removes netCDF4 utils private attributes from
32+
netCDF4 namespace, so has the potential to break code using private
33+
attributes (issue #409).
3034

3135
version 1.1.7 (tag v1.1.7rel)
3236
=============================

MANIFEST.in

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
recursive-include docs *
22
recursive-include man *
3+
recursive-include include *
34
include MANIFEST.in
45
include README.md
56
include COPYING
67
include Changelog
78
include setup.cfg
89
include setup.cfg.template
9-
include netCDF4.pyx
10-
include netCDF4_utils.py
11-
include netCDF4.pxi
12-
include netCDF4.c
13-
include utils.pyx
14-
include constants.pyx
1510
include examples/*py
1611
include examples/*ipynb
1712
include examples/README.md

create_docs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# svn propset svn:mime-type text/html docs/*html
2-
epydoc -v --no-frames --no-private --introspect-only -o docs netCDF4
2+
epydoc -v --no-frames --no-private --introspect-only --name netcdf4-python -o docs netCDF4._netCDF4
File renamed without changes.
File renamed without changes.
File renamed without changes.

netCDF4/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# init for netCDF4 package
2+
# Docstring comes from extension module _netCDF4
3+
from ._netCDF4 import *
4+
# Need explicit imports for names beginning with underscores
5+
from ._netCDF4 import __doc__
6+
from ._netCDF4 import (__version__, __netcdf4libversion__, __hdf5libversion__,
7+
__has_rename_grp__, __has_nc_inq_path__,
8+
__has_nc_inq_format_extended__)

netCDF4.c renamed to netCDF4/_netCDF4.c

Lines changed: 4808 additions & 4808 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

netCDF4.pyx renamed to netCDF4/_netCDF4.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,8 +768,8 @@ del __test__ # hack so epydoc doesn't show __test__
768768
# Make changes to this file, not the c-wrappers that Pyrex generates.
769769

770770
# pure python utilities
771-
from netCDF4_utils import _StartCountStride, _quantize, _find_dim, _walk_grps, \
772-
_out_array_shape, _sortbylist, _tostr
771+
from .utils import (_StartCountStride, _quantize, _find_dim, _walk_grps,
772+
_out_array_shape, _sortbylist, _tostr)
773773
# try to use built-in ordered dict in python >= 2.7
774774
try:
775775
from collections import OrderedDict

0 commit comments

Comments
 (0)