Skip to content

Commit

Permalink
Split Code into 2 repos, climakitae and climakitaegui. (#408)
Browse files Browse the repository at this point in the history
* Remove global class/function calls

* Trim GUI packages out of reqs.txt

* Move colormap util to new file

* Change colormap util ref change

* Move data_interface classes/funcs that need GUI to new gui file

* Black format

* Needed packages for Ubuntu pip install

* Make changes to setup.cfg to stop pip installing wrong packages

* Split agnostic into non-gui and gui

* Remove explore shortcuts as they have panel refs

* changes needed to have non-gui reqs

* Delete gui dir

* Change version to 0.2.0

* move needed func to gui repo

* Initial movement of warming code from base to gui

* Minor changes to warming.py to change to inheriting DataParameters only and not Panes

* Making initial changes to wl to get calculate to work without viz and fix colormaps file imports

* Change naming and move functions

* Rename funcs and move code to gui repo

* Set gwl_times to class var

* Attempt to just use self

* Try using a Mixin

* Trying extending with mixin

* Remove args

* Fix super call

* Try making warming_levels class var

* Pass self

* See if we can alias warming_levels

* Move and rename internal functions

* Boundaries documentation update

* Black format

* Update Boundary documentation

* Update data_interface documentation

* Black format

* Move _add_res_to_ax to gui side

* Update documentation

* document DataParameters class

* Document DataParameters class more

* Expand DataParameters documentation

* Document data_load and move functions around

* Black format

* Typo fix

* rename and move internal funcs

* Move geometry funcs

* Detailed documentation of data_load

* Detailed documentation and func rearrange data_view

* Detailed documentation and func moving of data_exports

* Formatting changes

* Formatting changes

* Black format

* Documentation updates

* Documentation updates

* Documentation updates

* Documentation updates

* Documentation updates

* Documentation updates

* Fix merge issues

* Black format

* Fix merge issues

* Fix merge issues

* Fix merge issues

* Fix merge issues

* Split explore AMY

* Split threshold tools

* Split thresholds

* Split timeseries

* Split vulnerability

* Move gui based test to gui repo

* Add shortcut export

* add load shortcut

* add ssp file paths for AMY

* Remove unused color refs

* Black format

* Redo warming split

* Fix thresholds refs

* Readd tests that were moved to climakitaegui

* Move data_view to climakitaegui

* Remove panel refs

* Move plotting utils to climakitaegui

* Change conda-lock and environment.yml to fit reduced reqs

* Try to install extra test packages with -nodeps

* Fix typo

* Fix refs in create test dataset scripts

* Try moving pip option position

* Fix typo...again...smh

* Add test list

* Add matplotlib

* Reset reqs.txt to try and fix tests

* Fiddle with setup.cfg

* remove extra pip installs from testing env

* change conda-lock file

* Add correct conda-lock

* Restore workflow

* Another conda-lock file try

* Yet another conda-lock

* Update list of submodules to document

- Add directive to document the new colormap module
- Remove directive to document the deleted data_view module

* Revert to original conda-lock to rework dependencies

* Update README

* Black format

* Fix ref

* Remove dup import

* Black format

* handle list input for scenario

* fix documentation

* fix mm/time bug

* Set version to 1.0.0

* Update `docs/requirements.txt`

add tqdm and remove seaborn

* fix silly bug with None as arguments

* Fix statsmodel version

* removing Ipython.display from ck version

* missing imports from vulnerability

* one more import for vuln

* reset to _ naming for vuln fns

* Black format

* Resolve merge conflict in docstring

* Black format

* Delete commented out code

* unit conversion happening twice, comment out first

* delete commented out code

* Update warming.py

Remove unused code

---------

Co-authored-by: claalmve <chencalvin99@berkeley.edu>
Co-authored-by: Victoria Ford <fordvecellio@gmail.com>
Co-authored-by: Tianchi-Liu <liutc@berkeley.edu>
Co-authored-by: nicolejkeeney <nicolejkeeney@gmail.com>
Co-authored-by: Tianchi-Liu <56141689+Tianchi-Liu@users.noreply.github.com>
Co-authored-by: Calvin Chen <33679281+claalmve@users.noreply.github.com>
  • Loading branch information
7 people authored Sep 5, 2024
1 parent 56329f2 commit 949fe42
Show file tree
Hide file tree
Showing 31 changed files with 1,518 additions and 4,863 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
use-only-tar-bz2: true
- name: Output conda info
run: conda info
- name: Output conda list
run: conda list
- name: Install pip packages
run: pip install dask-gateway==2023.1.1 dask-geopandas==0.3.1 xclim==0.42.0
- name: Install climakitae
Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Climakitae
==========
A python toolkit for retrieving, visualizing, and performing scientific analyses with climate data from the [Cal-Adapt Analytics Engine](https://analytics.cal-adapt.org).
A python toolkit for retrieving, and performing scientific analyses with climate data from the [Cal-Adapt Analytics Engine](https://analytics.cal-adapt.org).

**Note:** This package is in active development and should be considered a work in progress.

Documentation
--------------
-------------
Check out the official documentation on ReadTheDocs: https://climakitae.readthedocs.io/en/latest/

Installation
Expand All @@ -22,12 +22,10 @@ Basic Usage

```
import climakitae as ck # Import the package
sel = ck.Select().show() # Pull up selections GUI to make data settings
from climakitae.core.data_interface import DataParameters
sel = DataParameters() # Pull up selections to make data settings
data = sel.retrieve() # Retrieve the data from the AWS catalog
data = ck.load(data) # Read the data into memory
ck.view(data) # Generate a basic visualization of the data
from climakitae.explore import warming_levels # Import warming levels code
wl = warming_levels().show() # Explore Warming Levels GUI
```

Links
Expand All @@ -37,5 +35,5 @@ Links
* Issue tracker: https://github.com/cal-adapt/climakitae/issues

Contributors
-------------
------------
[![Contributors](https://contrib.rocks/image?repo=cal-adapt/climakitae)](https://github.com/cal-adapt/climakitae/graphs/contributors)
5 changes: 0 additions & 5 deletions climakitae/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from climakitae.core.data_interface import Select
from climakitae.core.data_load import load
from climakitae.core.data_view import view
from climakitae.core.data_export import export

try:
Expand All @@ -17,11 +15,8 @@
__version__ = "999"

__all__ = (
# Classes
"Select",
# Methods
"load",
"view",
"export",
# Constants
"__version__",
Expand Down
11 changes: 6 additions & 5 deletions climakitae/core/boundaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class Boundaries:
_ca_electric_balancing_areas = None

def __init__(self, boundary_catalog):
# Connect intake Catalog to class
self._cat = boundary_catalog

def load(self):
Expand Down Expand Up @@ -79,7 +80,7 @@ def load(self):

def _get_us_states(self):
"""
Returns a custom sorted dictionary of state abbreviations and indices.
Returns a custom sorted dictionary of western state abbreviations and indices.
Returns
-------
Expand Down Expand Up @@ -138,7 +139,7 @@ def _get_ca_watersheds(self):

def _get_forecast_zones(self):
"""
Returns a lookup dictionary for CA watersheds that references
Returns a lookup dictionary for CA Electricity Demand Forecast Zones that references
the geoparquet file.
Returns
Expand All @@ -152,7 +153,7 @@ def _get_forecast_zones(self):

def _get_ious_pous(self):
"""
Returns a lookup dictionary for IOUs & POUs that references
Returns a lookup dictionary for CA Electric Load Serving Entities IOUs & POUs that references
the geoparquet file.
Returns
Expand Down Expand Up @@ -197,8 +198,8 @@ def boundary_dict(self):
This returns a dictionary of lookup dictionaries for each set of
geoparquet files that the user might be choosing from. It is used to
populate the selector object dynamically as the category in
'_LocSelectorArea.area_subset' changes.
populate the `DataParameters` cached_area dynamically as the category
in the area_subset parameter changes.
Returns
-------
Expand Down
Loading

0 comments on commit 949fe42

Please sign in to comment.