diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9d319c9a..60015865 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,7 +34,7 @@ repos: rev: v0.6.7 hooks: - id: ruff - args: [--fix] + args: [--fix, '--extend-exclude', '*.ipynb'] - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.11.2 hooks: diff --git a/src/duqtools/dashboard/_shared.py b/src/duqtools/dashboard/_shared.py index b1dc5ccb..77c35982 100644 --- a/src/duqtools/dashboard/_shared.py +++ b/src/duqtools/dashboard/_shared.py @@ -106,20 +106,25 @@ def get_base64_of_bin_file(png_file): def build_markup_for_logo( - png_file, - background_position='50% 10%', - margin_top='10%', - image_width='60%', - image_height='', + png_file, + background_position='50% 10%', + margin_top='10%', + image_width='53%', + image_height='100%', + nav=True, # page has navigation ): binary_string = get_base64_of_bin_file(png_file) + + loc = 'stSidebarHeader' if nav else 'stSidebarUserContent' + return f""" @@ -129,7 +134,7 @@ def build_markup_for_logo( def add_sidebar_logo(): """Based on: https://stackoverflow.com/a/73278825.""" png_file = data_directory / 'logo.png' - logo_markup = build_markup_for_logo(png_file) + logo_markup = build_markup_for_logo(png_file, nav=True) st.markdown( logo_markup, unsafe_allow_html=True, diff --git a/src/duqtools/schema/_dimensions.py b/src/duqtools/schema/_dimensions.py index 0a0057a9..dc5dbcc7 100644 --- a/src/duqtools/schema/_dimensions.py +++ b/src/duqtools/schema/_dimensions.py @@ -105,7 +105,7 @@ def check_custom(cls, values): return values def _custom_function(self, - data: np.ndarray, + data: np.ndarray | float, value, *, out: Optional[np.ndarray] = None, @@ -125,6 +125,7 @@ def npfunc(self, out: Optional[np.ndarray] = None, var: Optional[Any] = None) -> Any: if self.operator == 'custom': + assert self.custom_code npfunc = partial(self._custom_function, code=self.custom_code, var=var)