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

Abstract routines out of gcpy/plot.py into smaller modules within the gcpy/plot folder #263

Merged
merged 10 commits into from
Oct 25, 2023

Commits on Sep 20, 2023

  1. Split up plotting modules and store in gcpy/plot folder

    This is the initial commit of the GCPy plot modules refactoring.  We
    have split up gcpy/plot.py into:
    
    gcpy/plot/core.py
    gcpy/plot/six_plot.py
    gcpy/plot/single_panel.py
    gcpy/plot/compare_single_level.py
    gcpy/plot/compare_zonal_mean.py
    
    Some issues remain but we just wanted to stash code here before
    moving on.  These issues will be resolved in subsequent commits.
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    2c77311 View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2023

  1. Fixed several issues preventing import of modules in gcpy/plot

    gcpy/plot/compare_single_level.py
    - Break up strings across multiple lines to avoid "line-too-long"
      warning from Pylint
    - Trimmed trailing whitespace
    
    gcpy/plot/compare_zonal_mean.py
    - Convert target_index from numpy.int64 to int, to avoid a Pylint
      "Sequence index" warning.  (List indices must be int but not
       numpy.int32 or numpy.int64)
    - Break up strings across multiple lines to avoid "line-too-long"
      warning from Pylint
    - Now import six_panel_subplot names from gcpy.plot.core (so no
      need to call core.six_panel_subplot_names).
    - Removed if __name__ == "__main__" block
    
    gcpy/plot/core.py
    - Removed unused import statement (as per Pylint)
    - Removed "self" from call to super().__init in MidpointLogNorm class
    - Removed if __name__ == "__main__" block
    
    gcpy/plot/single_panel.py
    - Now import normalize_colors from gcpy.plot.core (and replace the
      core.normalize_colors call with normalize_colors)
    - Removed if __name__ == "__main__" block
    
    gcpy/plot/six_plot.py
    - Remove unused import statements
    - Remove debug print statements
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    bb6f7b5 View commit details
    Browse the repository at this point in the history
  2. Additional refactoring in gcpy/plot/six_plot.py

    gcpy/plot/six_plot.py
    - Split the computation of vmin, vmax for absdiff and ratio plots
      into separate functions called by compute_vmin_vmax_for_plot
    - Make sure that all functions return a value (to avoid an
      "inconsistent-return-statements" warning by Pylint
    - Updated comments
    - Trimmed trailing whitespace
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    cad58ef View commit details
    Browse the repository at this point in the history
  3. Import functions from gcpy/plot folder in benchmark & example scripts

    gcpy/benchmark_funcs.py
    - Now import constants individually from gcpy.constants
    - Import compare_single_level from gcpy.plot.compare_single_level
    - Import compare_zonal_mean from gcpy.plot.compare_zonal_mean
    - Remove unneeded "warning_format" variable
    
    gcpy/examples/diagnostics/compare_diags.py
    - Remove unused import for xarray
    - Import functions individually from gcpy.util
    - Import constants individually from gcpy.constants
    - Import compare_single_level from gcpy.plot.compare_single_level
    - Import compare_zonal_mean from gcpy.plot.compare_zonal_mean
    - Now use dataset_reader to return the proper reader
    - Fix exception handling
    
    gcpy/examples/plotting/plot_comparisons.py
    - Import compare_single_level from gcpy.plot.compare_single_level
    - Import compare_zonal_mean from gcpy.plot.compare_zonal_mean
    
    gcpy/examples/plotting/plot_single_panel.py
    - Import single_panel from gcpy.plot.single_panel
    
    gcpy/examples/timeseries/mda8_o3_timeseries
    - Update plot styles for Matplolib 3.7.2
    
    gcpy/gcpy_plot_style
    - Removed, this is now in the plot folder
    
    gcpy/plot.py
    - Removed, this has now been split up to other modules in the plot folder
    
    gcpy/gcpy
    gcpy/gcpy.examples
    - Remove these extraneous files
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    a53c02f View commit details
    Browse the repository at this point in the history
  4. Change the default environment name in benchmark_slurm.sh

    gcpy/benchmark/benchmark_slurm.sh
    - Now activate the "gcpy_env" environment, which is the same name
      in the default environment.yml file (and in the documentation)
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    343e229 View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2023

  1. Fix colorbar tick placements for data in range of 1..100

    gcpy/six_plot.py
    - In routine "colorbar_for_small_data_range", now use
      pos = [vmin, vmin+vrange*0.25, vmin+vrange*0.5, vmin+vrange*0.75, vmax]
      which should place the intermediate tickpoints symmetrically.
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    8dedac7 View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2023

  1. Merge branch 'dev' into feature/plot-subdir

    This merge brings the feature/plot-subdir up-to-date with the dev
    branch (which now has the fixes for regridding that were added
    by PR #266).
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Oct 11, 2023
    Configuration menu
    Copy the full SHA
    4de592e View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2023

  1. Make sure to add "tk" to environment.yml

    docs/environment_files/environment.yml
    - Add the "tk" library to the GCPy python environment YAML file
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    1ff5581 View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2023

  1. Fix typo in comment in compare_diags.py

    gcpy/examples/diagnostics/compare_diags.py
    - Fixed typo "thed" -> "the"
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Oct 24, 2023
    Configuration menu
    Copy the full SHA
    1d85619 View commit details
    Browse the repository at this point in the history
  2. Update CHANGELOG.md with info about adding tk to environment.yml

    CHANGELOG.md
    - Now state that the 'tk' package has been added to the
      docs/environment_files/environment.yml file.
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Oct 24, 2023
    Configuration menu
    Copy the full SHA
    1c2ddc0 View commit details
    Browse the repository at this point in the history