Skip to content

Commit

Permalink
[#159] Renaming continued
Browse files Browse the repository at this point in the history
  • Loading branch information
dvezinet committed Nov 14, 2024
1 parent 06ee0a7 commit c0f68f2
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 26 deletions.
5 changes: 4 additions & 1 deletion datastock/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@

from . import _class1_compute
from . import _class1_compute
from . import _class1_compute

from .version import __version__

from . import _generic_check
from ._generic_utils_plot import *
from ._class04 import Plots as Collection
from ._class04_Plots import Plots as Collection
from ._saveload import load, get_files
from ._direct_calls import *
from . import tests
39 changes: 19 additions & 20 deletions datastock/_class02.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@


from . import _generic_check
from ._class1 import *
from . import _class2_interactivity
from . import _class1_compute
from ._class01 import DataStock1 as Previous
from . import _class02_interactivity as _interactivity


# #################################################################
Expand All @@ -24,7 +23,7 @@
# #################################################################


class DataStock2(DataStock1):
class DataStock2(Previous):
""" Handles matplotlib interactivity """

_LPAXES = ['axes', 'type']
Expand Down Expand Up @@ -311,7 +310,7 @@ def dinteractivity(self):
# ------------------

def show_commands(self, verb=None, returnas=None):
return _class2_interactivity.show_commands(
return _interactivity.show_commands(
verb=verb,
returnas=returnas,
)
Expand Down Expand Up @@ -363,7 +362,7 @@ def setup_interactivity(
# ----------
# Check dgroup

dgroup, newgroup = _class2_interactivity._setup_dgroup(
dgroup, newgroup = _interactivity._setup_dgroup(
dgroup=dgroup,
dobj0=self._dobj,
dref0=self._dref,
Expand All @@ -372,7 +371,7 @@ def setup_interactivity(
# ----------
# Check increment dict

dinc, newinc = _class2_interactivity._setup_dinc(
dinc, newinc = _interactivity._setup_dinc(
dinc=dinc,
lparam_ref=self.get_lparam(which='ref'),
dref0=self._dref,
Expand All @@ -381,7 +380,7 @@ def setup_interactivity(
# ----------------------------------------------------------
# make sure all refs are known and are associated to a group

drefgroup = _class2_interactivity._setup_drefgroup(
drefgroup = _interactivity._setup_drefgroup(
dref0=self._dref,
dgroup=dgroup,
)
Expand Down Expand Up @@ -451,7 +450,7 @@ def setup_interactivity(
# --------------------------
# update mobile with group, group_vis and func

_class2_interactivity._setup_mobile(
_interactivity._setup_mobile(
dmobile=self._dobj['mobile'],
dref=self._dref,
ddata=self._ddata,
Expand Down Expand Up @@ -486,7 +485,7 @@ def setup_interactivity(
# ---------
# dkeys

dkeys = _class2_interactivity._setup_keys(dkeys=dkeys, dgroup=dgroup)
dkeys = _interactivity._setup_keys(dkeys=dkeys, dgroup=dgroup)

# implement dict
for ii, (k0, v0) in enumerate(dkeys.items()):
Expand Down Expand Up @@ -532,7 +531,7 @@ def setup_interactivity(
**dinter,
)

_class2_interactivity._set_dbck(
_interactivity._set_dbck(
lax=self._dobj['axes'].keys(),
daxes=self._dobj['axes'],
dcanvas=self._dobj['canvas'],
Expand Down Expand Up @@ -904,7 +903,7 @@ def _update_mobiles(self, lmobiles=None):

# ---- update data of group objects ---- 0.15 s
for k0 in lmobiles:
_class2_interactivity._update_mobile(
_interactivity._update_mobile(
dmobile=self._dobj['mobile'],
dref=self._dref,
ddata=self._ddata,
Expand Down Expand Up @@ -941,7 +940,7 @@ def _update_mobiles(self, lmobiles=None):
# ----------------------

def resize(self, event):
_class2_interactivity._set_dbck(
_interactivity._set_dbck(
lax=self._dobj['axes'].keys(),
daxes=self._dobj['axes'],
dcanvas=self._dobj['canvas'],
Expand All @@ -955,7 +954,7 @@ def new_home(self, *args):
v0['handle'].manager.toolbar.__class__,
v0['handle'].manager.toolbar,
).home(*args)
_class2_interactivity._set_dbck(
_interactivity._set_dbck(
lax=self._dobj['axes'].keys(),
daxes=self._dobj['axes'],
dcanvas=self._dobj['canvas'],
Expand Down Expand Up @@ -1014,7 +1013,7 @@ def mouseclic(self, event):
gax += self._dobj['axes'][kax]['groupy']
for gg in set([cur_groupx, cur_groupy]):
if gg is not None and gg in gax:
out = _class2_interactivity._update_indices_nb(
out = _interactivity._update_indices_nb(
group=gg,
dgroup=self._dobj['group'],
ctrl=ctrl,
Expand Down Expand Up @@ -1055,7 +1054,7 @@ def mouseclic(self, event):
and cur_refx in self._dobj['axes'][kax]['refx']
)
if c0x:
ix = _class2_interactivity._get_ix_for_refx_only_1or2d(
ix = _interactivity._get_ix_for_refx_only_1or2d(
cur_data=cur_datax,
cur_ref=cur_refx,
eventdata=event.xdata,
Expand All @@ -1072,7 +1071,7 @@ def mouseclic(self, event):
and cur_refy in self._dobj['axes'][kax]['refy']
)
if c0y:
iy = _class2_interactivity._get_ix_for_refx_only_1or2d(
iy = _interactivity._get_ix_for_refx_only_1or2d(
cur_data=cur_datay,
cur_ref=cur_refy,
eventdata=event.ydata,
Expand Down Expand Up @@ -1142,7 +1141,7 @@ def mouserelease(self, event):
][0]
for ax in lax
]
_class2_interactivity._set_dbck(
_interactivity._set_dbck(
lax=lax,
daxes=self._dobj['axes'],
dcanvas=self._dobj['canvas'],
Expand Down Expand Up @@ -1339,7 +1338,7 @@ def onkeypress(self, event):
return

# update nb of visible indices
out = _class2_interactivity._update_indices_nb(
out = _interactivity._update_indices_nb(
group=group,
dgroup=self._dobj['group'],
ctrl=ctrl,
Expand Down Expand Up @@ -1393,4 +1392,4 @@ def on_close(self, event):

__all__ = [
sorted([k0 for k0 in locals() if k0.startswith('DataStock')])[-1]
]
]
8 changes: 4 additions & 4 deletions datastock/_class02_interactivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from . import _generic_check
from . import _generic_utils
from . import _class1_compute
from . import _class01_compute


_INCREMENTS = [1, 10]
Expand Down Expand Up @@ -256,7 +256,7 @@ def _setup_mobile(

# functions for slicing
dmobile[k0]['func_slice'] = [
_class1_compute._get_slice(
_class01_compute._get_slice(
laxis=dmobile[k0]['axis'][ii],
ndim=(
1 if dmobile[k0]['data'][ii] == 'index'
Expand Down Expand Up @@ -442,7 +442,7 @@ def _get_ix_for_refx_only_1or2d(
raise NotImplementedError()

# get index of datax corresponding to clicked point
return _class1_compute._get_index_from_data(
return _class01_compute._get_index_from_data(
data=cd,
data_pick=np.r_[eventdata],
monot=monot,
Expand Down Expand Up @@ -588,4 +588,4 @@ def _update_mobile(k0=None, dmobile=None, dref=None, ddata=None):
# ddata[dmobile[k0]['data'][ii]]['data'][
# dmobile[k0]['func_slice'][ii](iref[ii])
# ]
# )
# )
1 change: 1 addition & 0 deletions datastock/_class03_Bins.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
from . import _class1_compute


# Built-in
Expand Down
2 changes: 1 addition & 1 deletion datastock/_class03_binning.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,4 +356,4 @@ def _get_nobins(
for k0, v0 in dout.items():
coll.add_data(key=k0, **v0)

return dout
return dout

0 comments on commit c0f68f2

Please sign in to comment.