diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index c395c43..b87f2f3 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,32 +1,29 @@ --- name: Bug report about: Create a report to help us improve -title: '' -labels: '' -assignees: '' +labels: bug +title: "BUG: " --- -**Describe the bug** -A clear and concise description of what the bug is. +# Description +A clear and concise description of what the bug is, including a description +of what you expected the outcome to be. -**To Reproduce** +# To Reproduce this bug: Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error -**Expected behavior** -A clear and concise description of what you expected to happen. +Consider including images or test files to help others reproduce the bug and +solve the problem. -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Version [e.g. 22] +## Test configuration + - OS: [e.g. Hal] + - Version [e.g. Python 3.47] - Other details about your setup that could be relevant -**Additional context** +# Additional context Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bbcbbe7..d02da2e 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,20 +1,27 @@ --- name: Feature request about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' +title: "ENH: " +labels: enhancement --- -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] +# Description +A clear and concise description of the new feature or behaviour you would like. -**Describe the solution you'd like** +## Potential impact + +- Is the feature related to an existing problem? +- How critical is this feature to your workflow? +- How wide of an impact to you anticipate this enhancement having? +- Would this break any existing functionality? + +## Potential solution(s) A clear and concise description of what you want to happen. -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. +# Alternatives +A clear description of any alternative solutions or features you've considered. -**Additional context** -Add any other context or screenshots about the feature request here. +# Additional context +Add any other context or screenshots about the feature request here, potentially +including your operational configuration. diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 8c5791a..e0a2dad 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,19 +12,18 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.7] + python-version: ["3.9"] name: Documentation tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip pip install -r test_requirements.txt pip install -r requirements.txt diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cbfa5d6..c427bea 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,28 +15,29 @@ jobs: numpy_ver: [latest] include: - python-version: "3.8" - numpy_ver: "1.19" + numpy_ver: "1.20" os: "ubuntu-latest" name: Python ${{ matrix.python-version }} on ${{ matrix.os }} with numpy ${{ matrix.numpy_ver }} runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r test_requirements.txt - pip install -r requirements.txt - - name: Install NEP29 dependencies if: ${{ matrix.numpy_ver != 'latest'}} run: | pip install --no-binary :numpy: numpy==${{ matrix.numpy_ver }} + # Need to force a version of pandas compliant with NEP29 + pip install "pandas<1.5" + + - name: Install dependencies + run: | + pip install -r test_requirements.txt + pip install -r requirements.txt - name: Test PEP8 compliance run: flake8 . --count --select=E,F,W --show-source --statistics diff --git a/.github/workflows/pysat_rc.yml b/.github/workflows/pysat_rc.yml new file mode 100644 index 0000000..059ac9f --- /dev/null +++ b/.github/workflows/pysat_rc.yml @@ -0,0 +1,51 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Test with latest pysat RC + +on: [workflow_dispatch] + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + python-version: ["3.10"] + + name: Python ${{ matrix.python-version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Reinstall fortran on MacOS + if: ${{ matrix.os == 'macos-latest' }} + run: brew reinstall gcc + + - name: Install pysat RC + run: pip install --no-deps -i https://test.pypi.org/simple/ pysat + + - name: Install standard dependencies + run: | + pip install -r requirements.txt + pip install -r test_requirements.txt + + - name: Set up pysat + run: | + mkdir pysatData + python -c "import pysat; pysat.params['data_dirs'] = 'pysatData'" + + - name: Install + run: python setup.py develop + + - name: Test with pytest + run: pytest -vs --cov=pysatCDF/ + + - name: Publish results to coveralls + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: coveralls --rcfile=setup.cfg --service=github diff --git a/.zenodo.json b/.zenodo.json index 07180e3..860a27f 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -20,6 +20,16 @@ { "affiliation": "Predictive Science", "name": "Pembroke, Asher" + }, + { + "affiliation": "The Johns Hopkins Applied Physics Laboratory", + "name": "Starr, Greg", + "orcid": "0000-0002-3487-3630" + }, + { + "affiliation": "SRI International", + "name": "Reimer, Ashton", + "orcid": "0000-0002-4621-3453" } ] } diff --git a/CHANGELOG.md b/CHANGELOG.md index 14b4c58..592c66b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,14 +3,37 @@ Change Log All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/). -[0.4.0] - 2022-XX-XX +[0.3.2] - 2022-05-13 -------------------- * New Features * Compatible with pysat v3.0+ * Deprecations * Documentation + * Added pull request templates and other GitHub project documentation. + * Switched Windows installation instructions to favor installing WSL. * Bug Fix * Improved builds for newer compilers. + * Replaces uninterpretable characters with '*' so data loading may continue. * Maintenance * Adopted latest pysat development standards. + * Shifted from TravisCI to GitHub Actions for online testing. + * Adopted setup.cfg + * Improved PEP8 compliance + * Adopt pytest syntax +[0.3.2] - 2022-05-13 +-------------------- +* New Features + * Compatible with pysat v3.0+ +* Deprecations +* Documentation + * Added pull request templates and other GitHub project documentation. + * Switched Windows installation instructions to favor installing WSL. +* Bug Fix + * Improved builds for newer compilers. + * Replaces uninterpretable characters with '*' so data loading may continue. +* Maintenance + * Adopted latest pysat development standards. + * Shifted from TravisCI to GitHub Actions for online testing. + * Adopted setup.cfg + * Improved PEP8 compliance diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..f1016fe --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,146 @@ +Contributing +============ + +Bug reports, feature suggestions and other contributions are greatly +appreciated! pysatCDF is a community-driven project and welcomes both +feedback and contributions. + +Come join us on Slack! An invitation to the pysat workspace is available +in the 'About' section of the +[pysat GitHub Repository.](https://github.com/pysat/pysat) Development meetings +are generally held fortnightly. + +Short version +------------- + +* Submit bug reports and feature requests at [GitHub](https://github.com/pysat/pysatCDF/issues) +* Make pull requests to the ``develop`` branch + +Bug reports +----------- + +When [reporting a bug](https://github.com/pysat/pysatCDF/issues) please +include: + +* Your operating system name and version +* Any details about your local setup that might be helpful in troubleshooting +* Detailed steps to reproduce the bug + +Feature requests and feedback +----------------------------- + +The best way to send feedback is to file an issue at +[GitHub](https://github.com/pysat/pysatCDF/issues). + +If you are proposing a feature: + +* Explain in detail how it would work. +* Keep the scope as narrow as possible, to make it easier to implement. +* Remember that this is a volunteer-driven project, and that code contributions + are welcome :) + +Development +----------- + +To set up `pysatCDF` for local development: + +1. [Fork pysat on GitHub](https://github.com/pysat/pysatCDF/fork). + +2. Clone your fork locally: + ``` + git clone git@github.com:your_name_here/pysatCDF.git + ``` + +3. Create a branch for local development: + ``` + git checkout -b name-of-your-bugfix-or-feature + ``` + + Now you can make your changes locally. Tests for new instruments are + performed automatically. Tests for custom functions should be added to + the appropriately named file in ``pysatCDF/tests``. If no test + file exists, then you should create one. This testing uses pytest, which + will run tests on any python file in the test directory that starts with + ``test_``. + +4. When you're done making changes, run all the checks to ensure that nothing + is broken on your local system: + ``` + pytest -vs + ``` + +5. Update/add documentation (in ``docs``), if relevant + +6. Add your name to the .zenodo.json file as an author + +7. Commit your changes: + ``` + git add . + git commit -m "AAA: Brief description of your changes" + ``` + Where AAA is a standard shorthand for the type of change (eg, BUG or DOC). + `pysat` follows the [numpy development workflow](https://numpy.org/doc/stable/dev/development_workflow.html), + see the discussion there for a full list of this shorthand notation. + +8. Once you are happy with the local changes, push to Github: + ``` + git push origin name-of-your-bugfix-or-feature + ``` + Note that each push will trigger the Continuous Integration workflow. + +9. Submit a pull request through the GitHub website. Pull requests should be + made to the ``develop`` branch. + +Pull Request Guidelines +----------------------- + +If you need some code review or feedback while you're developing the code, just +make a pull request. Pull requests should be made to the ``develop`` branch. + +For merging, you should: + +1. Include an example for use +2. Add a note to ``CHANGELOG.md`` about the changes +3. Ensure that all checks passed (current checks include GitHub Actions + and Coveralls) + +If you don't have all the necessary Python versions available locally or +have trouble building all the testing environments, you can rely on +the project's Continuous Integration (CI) service to run the tests for each change you add in the pull +request. Because testing here will delay tests by other developers, +please ensure that the code passes all tests on your local system first. + +Project Style Guidelines +^^^^^^^^^^^^^^^^^^^^^^^^ + +In general, pysat follows PEP8 and numpydoc guidelines. Pytest runs the unit +and integration tests, flake8 checks for style, and sphinx-build performs +documentation tests. However, there are certain additional style elements that +have been settled on to ensure the project maintains a consistent coding style. +These include: + +* Line breaks should occur before a binary operator (ignoring flake8 W503) +* Combine long strings using `join` +* Preferably break long lines on open parentheses rather than using `\` +* Use no more than 80 characters per line +* Avoid using Instrument class key attribute names as unrelated variable names: + `platform`, `name`, `tag`, and `inst_id` +* The pysat logger is imported into each sub-module and provides status updates + at the info and warning levels (as appropriate) +* Several dependent packages have common nicknames, including: + * `import datetime as dt` + * `import numpy as np` + * `import pandas as pds` + * `import xarray as xr` +* All classes should have `__repr__` and `__str__` functions +* Docstrings use `Note` instead of `Notes` +* Try to avoid creating a try/except statement where except passes +* Use setup and teardown in test classes +* Use pytest parametrize in test classes when appropriate +* Provide testing class methods with informative failure statements and + descriptive, one-line docstrings +* Block and inline comments should use proper English grammar and punctuation + with the exception of single sentences in a block, which may then omit the + final period +* When casting is necessary, use `np.int64` and `np.float64` to ensure operating + system agnosticism diff --git a/LICENSE b/LICENSE index 5cd0284..3a54a46 100644 --- a/LICENSE +++ b/LICENSE @@ -11,7 +11,7 @@ modification, are permitted provided that the following conditions are met: this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -* Neither the name of pysat nor the names of its +* Neither the name of pysatCDF nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/MANIFEST.in b/MANIFEST.in index 0109c75..4689c47 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,7 @@ include *.py include *.f include *.c +include pysatCDF/version.txt recursive-include cdf36_3-dist * prune cdf36_3-dist/cdfjava prune cdf36_3-dist/lib/*.o diff --git a/README.md b/README.md index 7f3011e..73add3d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +
+ + pysatCDF +
+ # pysatCDF [![PyPI Package latest release](https://img.shields.io/pypi/v/pysatcdf.svg)](https://pypi.python.org/pypi/pysatcdf) [![Build Status](https://github.com/pysat/pysatCDF/actions/workflows/main.yml/badge.svg)](https://github.com/pysat/pysatCDF/actions/workflows/main.yml/badge.svg) @@ -40,7 +45,7 @@ Provide simple, robust access to CDF data in Python and simplify adding instruments to [pysat](https://github.com/pysat/pysat). # Installation in POSIX compatible environments -Actual CDF loading is performed by the [NASA CDF libraries] (http://cdf.gsfc.nasa.gov/html/sw_and_docs.html) +Actual CDF loading is performed by the [NASA CDF libraries](http://cdf.gsfc.nasa.gov/html/sw_and_docs.html) which are included with pysatCDF. To install pysatCDF @@ -63,3 +68,4 @@ and then install pysatCDF as normal. # Installing pysatCDF in Windows Install the Windows Subsytem for Linux and proceed as per POSIX installation. + diff --git a/bld.bat b/bld.bat new file mode 100644 index 0000000..c40a9bb --- /dev/null +++ b/bld.bat @@ -0,0 +1,2 @@ +"%PYTHON%" setup.py install +if errorlevel 1 exit 1 diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..762d43b --- /dev/null +++ b/build.sh @@ -0,0 +1 @@ +python setup.py install diff --git a/docs/images/logo.png b/docs/images/logo.png new file mode 100644 index 0000000..2ea35f4 Binary files /dev/null and b/docs/images/logo.png differ diff --git a/meta.yaml b/meta.yaml new file mode 100644 index 0000000..d1ac8cd --- /dev/null +++ b/meta.yaml @@ -0,0 +1,33 @@ +package: + name: pysatcdf + version: 0.1 + +source: + path: ./ + +requirements: + build: + - python + - libpython # [win] + - numpy >=1.15 + - m2-make # [win] + - m2-base # [win] + - m2w64-make # [win] + - m2w64-toolchain # [win] + - m2w64-gcc # [win] + + + run: + - python + - numpy >=1.15 + + +test: + imports: + - pysatCDF + + +about: + home: + license: BSD + summary: Reader for NASA CDF files diff --git a/pysatCDF/__init__.py b/pysatCDF/__init__.py index ca138e0..42a5570 100644 --- a/pysatCDF/__init__.py +++ b/pysatCDF/__init__.py @@ -7,12 +7,12 @@ import os -# Set version +# Import CDF interface. +from pysatCDF._cdf import CDF as CDF + +# Set version. here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'version.txt')) as version_file: __version__ = version_file.read().strip() -# Import CDF interface -from ._cdf import CDF as CDF - del here diff --git a/pysatCDF/_cdf.py b/pysatCDF/_cdf.py index a636934..1c692a6 100644 --- a/pysatCDF/_cdf.py +++ b/pysatCDF/_cdf.py @@ -46,7 +46,7 @@ def __init__(self, fname): self.data_loaded = False - # CDF library numeric codes for data types + # CDF library numeric codes for data types. cdty = {} cdty['real4'] = 21 cdty['float'] = 44 @@ -69,19 +69,19 @@ def __init__(self, fname): self.cdf_data_types = cdty if status == 0: - # Inquire as to files contents + # Inquire as to files contents. self.inquire() - # Get all attribute info + # Get all attribute info. self._read_all_attribute_info() - # Get z variable info, basic stats on the variables + # Get z variable info, basic stats on the variables. self._read_all_z_variable_info() - # Load variables + # Load variables. self.load_all_variables() - # Load all variable attribute data (zVariables) + # Load all variable attribute data (zVariables). self._read_all_z_attribute_data() else: raise IOError(fortran_cdf.statusreporter(status)) @@ -109,7 +109,7 @@ def inquire(self): name = copy.deepcopy(self.fname) stats = fortran_cdf.inquire(name) - # Break out fortran output into something meaningful + # Break out fortran output into something meaningful. status = stats[0] if status == 0: self._num_dims = stats[1] @@ -158,7 +158,7 @@ def _read_all_z_variable_info(self): out['dim_varys'] = dim_varys[i] out['num_dims'] = num_dims[i] - # Only looking at first possible extra dimension + # Only looking at first possible extra dimension. out['dim_sizes'] = dim_sizes[i, :1] if out['dim_sizes'][0] == 0: out['dim_sizes'][0] += 1 @@ -181,7 +181,7 @@ def load_all_variables(self): self.data = {} - # Need to add r variable names + # Need to add r variable names. file_var_names = self.z_variable_info.keys() # Collect variable information for each, organize it neatly for @@ -199,7 +199,7 @@ def load_all_variables(self): rec_nums = np.array(rec_nums) data_types = np.array(data_types) - # Individually load all variables by each data type + # Individually load all variables by each data type. self._call_multi_fortran_z(names, data_types, rec_nums, dim_sizes, self.cdf_data_types['real4'], fortran_cdf.get_multi_z_real4) @@ -249,7 +249,7 @@ def load_all_variables(self): fortran_cdf.get_multi_z_tt2000, epoch=True) - # Mark data has been loaded + # Mark data has been loaded. self.data_loaded = True return diff --git a/pysatCDF/tests/test_cdf.py b/pysatCDF/tests/test_cdf.py index ea423ec..12a416b 100644 --- a/pysatCDF/tests/test_cdf.py +++ b/pysatCDF/tests/test_cdf.py @@ -3,12 +3,12 @@ import pysatCDF -class TestBasics(): - def setup(self): - """Runs before every method to create a clean testing setup.""" +class TestBasics(object): + def setup_method(self): + """Run before every method to create a clean testing setup.""" - def teardown(self): - """Runs after every method to clean up previous testing.""" + def teardown_method(self): + """Run after every method to clean up previous testing.""" def test_vefi_load(self): """Load VEFI file and perform basic data checks.""" diff --git a/pysatCDF/version.txt b/pysatCDF/version.txt index a2268e2..9fc80f9 100644 --- a/pysatCDF/version.txt +++ b/pysatCDF/version.txt @@ -1 +1 @@ -0.3.1 \ No newline at end of file +0.3.2 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 0e5d9d9..3bbff39 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ -matplotlib numpy pandas pysat>=3.0 diff --git a/setup.cfg b/setup.cfg index 7f2e5b9..98cc5d4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,7 +18,8 @@ classifiers = Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Operating System :: POSIX :: Linux - Operating System :: POSIX :: MacOS X + Operating System :: MacOS :: MacOS X + Operating System :: Microsoft :: Windows keywords = CDF NASA @@ -34,8 +35,12 @@ include_package_data = True zip_safe = False install_requires = numpy pandas + pysat xarray +[options.package_data] +* = *.txt + [coverage:run] [coverage:report] @@ -49,8 +54,6 @@ ignore = pysatCDF/__init__.py F401 exclude = conf.py - tests - __init__.py [tool:pytest] markers = diff --git a/setup.py b/setup.py index 3fc4e9a..226dd9d 100644 --- a/setup.py +++ b/setup.py @@ -13,10 +13,10 @@ import numpy as np import numpy.distutils -import numpy.distutils.core from numpy.distutils.command.build_ext import build_ext from numpy.distutils.command.build_src import build_src from numpy.distutils.command.build import build +import numpy.distutils.core from subprocess import call @@ -30,6 +30,7 @@ # Leave items below to None # name of library, e.g. for mac os x, libcdf.a lib_name = None + # Shared library name, needed for some systems (do not use on Mac OS X) shared_lib_name = None # CDF compile options @@ -40,34 +41,36 @@ os_name = None env_name = None -# manual f2py command for Mac OS X +# Manual f2py command for Mac OS X # f2py -c --include-paths $CDF_INC -I$CDF_INC $CDF_LIB/libcdf.a -m # fortran_cdf fortran_cdf.f -lm -lc -# some solutions in creating this file come from +# Some solutions in creating this file come from # https://github.com/Turbo87/py-xcsoar/blob/master/setup.py -# get system parameters +# Get system parameters platform = sys.platform if platform == 'darwin': os_name = 'macosx' env_name = 'x86_64' lib_name = 'libcdf.a' - # including shared lib in mac breaks things - shared_lib_name = None # 'libcdf.dylib' + + # Including shared lib in mac breaks things, 'libcdf.dylib' + shared_lib_name = None extra_link_args = ['-lm', '-lc'] elif (platform == 'linux') | (platform == 'linux2'): os_name = 'linux' env_name = 'gnu' lib_name = 'libcdf.a' - shared_lib_name = None # 'libcdf.so' + + # Disabling shared lib, but would be 'libcdf.so' + shared_lib_name = None extra_link_args = ['-lm', '-lc'] elif (platform == 'win32'): os_name = 'mingw' env_name = 'gnu' lib_name = 'libcdf.a' shared_lib_name = None - # extra_link_args = ['/nodefaultlib:libcd'] extra_link_args = [] else: check = ((os_name is None) or (env_name is None) @@ -93,18 +96,14 @@ def run(self): def CDF_build(self, ppath): """Build the cdf files.""" - # build CDF Library + # Build CDF Library build_path = os.path.abspath(ppath) if platform == 'win32': # Replace backslashes with forward slashes to avoid path being # mangled by escape sequences build_path = build_path.replace('\\', '/') - # print (' ') - # print ("In CDF_build ", build_path, CDF_PATH, ppath) - # print(' ') - # print(' ') - # check if library already exists + # Check if library already exists if (not os.path.isfile(os.path.join(self.build_lib, 'pysatCDF', 'lib', @@ -123,15 +122,15 @@ def CDF_build(self, ppath): 'INSTALLDIR=' + build_path, 'install', '>/dev/null 2>&1'] - # clean any previous attempts + # Clean any previous attempts def compile0(): call(cmd0, cwd=CDF_PATH) - # set compile options via makefile + # Set compile options via makefile def compile1(): call(cmd, cwd=CDF_PATH) - # do the installation + # Do the installation def compile2(): print('Build path: ', build_path, ' Current Working: ', CDF_PATH) call(cmd2, cwd=CDF_PATH) @@ -140,12 +139,10 @@ def compile2(): self.execute(compile2, [], 'Compiling CDF') self.execute(compile0, [], 'Cleaning CDF') - # copy resulting tool to library build folder + # Copy resulting tool to library build folder self.mkpath(os.path.join(ppath, 'pysatCDF')) if not self.dry_run: - # print ("Not a dry run") - # print(" ") self.copy_tree(os.path.join(ppath, 'include'), os.path.join(self.build_lib, 'pysatCDF', 'include')) self.mkpath(os.path.join(self.build_lib, 'pysatCDF', 'lib')) @@ -158,8 +155,6 @@ def compile2(): os.path.join(self.build_lib, 'pysatCDF', 'lib', shared_lib_name)) - # run original build code - # build.run(self) return @@ -167,17 +162,17 @@ class ExtensionBuild(build_src): def run(self): CDF_build(self, self.build_src) - # print 'yo yo yo' - # print (self.__dict__) lib_path = os.path.abspath(os.path.join(self.build_lib, 'pysatCDF')) - # set directories for the CDF library installed with pysatCDF + + # Set directories for the CDF library installed with pysatCDF self.extensions[0].include_dirs = [os.path.join(lib_path, 'include')] self.extensions[0].f2py_options = ['--include-paths', os.path.join(lib_path, 'include'), '--quiet'] self.extensions[0].extra_objects = [os.path.join(lib_path, 'lib', lib_name)] - # add shared library, if provided + + # Add shared library, if provided if shared_lib_name is not None: self.extensions[0].extra_link_args.append( os.path.join(lib_path, 'lib', shared_lib_name)) @@ -186,7 +181,7 @@ def run(self): return -# almost to building +# Almost to building if not build_cdf_flag: print(' '.join(('Using CDF installation at', base_cdf))) f2py_cdf_include_path = os.path.join(base_cdf, 'include') @@ -199,7 +194,7 @@ def run(self): f2py_cdf_include_path = '' f2py_cdf_lib_path = '' -# setup fortran extension +# Setup fortran extension # --------------------------------------------------------------------------- ext1 = numpy.distutils.core.Extension( @@ -212,6 +207,6 @@ def run(self): extra_link_args=extra_link_args) -# call setup +# Call setup # -------------------------------------------------------------------------- numpy.distutils.core.setup(ext_modules=[ext1], cmdclass=cmdclass) diff --git a/test_requirements.txt b/test_requirements.txt index 5b59aa8..e7761b5 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -1,7 +1,7 @@ coveralls +flake8<6.0 ipython m2r2 -nose numpydoc pytest-cov pytest-flake8