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

Merge release/v1.2.0 to develop #5302

Merged
merged 23 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cf3d4a2
Fixes an issue where spliting the panel space wrongly triggers on_unload
manivoxel51 Dec 18, 2024
b92e747
fix load_evaluation bug with serialized_info
imanjra Dec 19, 2024
f254567
Merge pull request #5301 from voxel51/bugfix/load-regression-eval-error
Br2850 Dec 19, 2024
add8ff1
Merge branch 'release/v1.2.0' of https://github.com/voxel51/fiftyone …
voxel51-bot Dec 19, 2024
79349af
model evaluation panel permission ux tweaks
imanjra Dec 10, 2024
8d5be1f
Merge branch 'release/v1.2.0' of https://github.com/voxel51/fiftyone …
voxel51-bot Dec 19, 2024
9f78594
add example databricks connector to data lens docs
tom-vx51 Dec 19, 2024
91a8e95
add example of dynamic operator to data lens docs
tom-vx51 Dec 19, 2024
d725315
use _confusion_matrix()
brimoor Nov 25, 2024
585411c
not the right place to implement "other"
brimoor Nov 25, 2024
01c11cc
support missing count in confusion matrix in model eval panel
imanjra Dec 19, 2024
84cbf13
Merge branch 'release/v1.2.0' of https://github.com/voxel51/fiftyone …
voxel51-bot Dec 19, 2024
613913f
Merge pull request #5296 from voxel51/bug/split-unload
manivoxel51 Dec 19, 2024
e5cd1bd
Merge pull request #5303 from voxel51/feat/lens-docs-update
tom-vx51 Dec 19, 2024
25467d8
Merge branch 'merge/release/v1.2.0' of https://github.com/voxel51/fif…
voxel51-bot Dec 19, 2024
65f977e
Merge branch 'release/v1.2.0' of https://github.com/voxel51/fiftyone …
voxel51-bot Dec 19, 2024
4953b31
bump to ETA v0.13.1
brimoor Dec 20, 2024
fd08265
adding release notes
brimoor Dec 20, 2024
4e04f98
more notes
brimoor Dec 20, 2024
45a8a28
Merge pull request #5307 from voxel51/release-notes
brimoor Dec 20, 2024
5e53d95
Merge branch 'release/v1.2.0' of https://github.com/voxel51/fiftyone …
voxel51-bot Dec 20, 2024
50970e9
Merge pull request #5305 from voxel51/bugfix/dataset-first
brimoor Dec 20, 2024
eee6553
Merge branch 'release/v1.2.0' of https://github.com/voxel51/fiftyone …
voxel51-bot Dec 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
import { MuiButton } from "@fiftyone/components";
import { Add } from "@mui/icons-material";
import { Box } from "@mui/material";
import React from "react";

export default function Evaluate(props: EvaluateProps) {
const { onEvaluate } = props;
const { onEvaluate, permissions } = props;
const canEvaluate = permissions.can_evaluate;
return (
<MuiButton onClick={onEvaluate} startIcon={<Add />} variant="contained">
Evaluate Model
</MuiButton>
<Box
title={canEvaluate ? "" : "You do not have permission to evaluate model"}
sx={{ cursor: canEvaluate ? "pointer" : "not-allowed" }}
>
<MuiButton
onClick={onEvaluate}
startIcon={<Add />}
variant="contained"
disabled={!canEvaluate}
>
Evaluate Model
</MuiButton>
</Box>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import { formatValue, getNumericDifference, useTriggerEvent } from "./utils";
const KEY_COLOR = "#ff6d04";
const COMPARE_KEY_COLOR = "#03a9f4";
const DEFAULT_BAR_CONFIG = { sortBy: "default" };
const NONE_CLASS = "(none)";

export default function Evaluation(props: EvaluationProps) {
const {
Expand Down Expand Up @@ -611,20 +612,26 @@ export default function Evaluation(props: EvaluationProps) {
<Card sx={{ p: 2 }}>
<Stack direction="row" sx={{ justifyContent: "space-between" }}>
<Typography color="secondary">Evaluation notes</Typography>
{can_edit_note && (
<Box>
<IconButton
size="small"
color="secondary"
sx={{ borderRadius: 16 }}
onClick={() => {
setEditNoteState((note) => ({ ...note, open: true }));
}}
>
<EditNote />
</IconButton>
</Box>
)}
<Box
title={
can_edit_note
? ""
: "You do not have permission to edit evaluation notes"
}
sx={{ cursor: can_edit_note ? "pointer" : "not-allowed" }}
>
<IconButton
size="small"
color="secondary"
sx={{ borderRadius: 16 }}
onClick={() => {
setEditNoteState((note) => ({ ...note, open: true }));
}}
disabled={!can_edit_note}
>
<EditNote />
</IconButton>
</Box>
</Stack>
<EvaluationNotes notes={evaluationNotes} variant="details" />
</Card>
Expand Down Expand Up @@ -1656,12 +1663,23 @@ function getMatrix(matrices, config, maskTargets, compareMaskTargets?) {
if (!matrices) return;
const { sortBy = "az", limit } = config;
const parsedLimit = typeof limit === "number" ? limit : undefined;
const classes = matrices[`${sortBy}_classes`].slice(0, parsedLimit);
const matrix = matrices[`${sortBy}_matrix`].slice(0, parsedLimit);
const originalClasses = matrices[`${sortBy}_classes`];
const originalMatrix = matrices[`${sortBy}_matrix`];
const classes = originalClasses.slice(0, parsedLimit);
const matrix = originalMatrix.slice(0, parsedLimit);
const colorscale = matrices[`${sortBy}_colorscale`];
const labels = classes.map((c) => {
return compareMaskTargets?.[c] || maskTargets?.[c] || c;
});
const noneIndex = originalClasses.indexOf(NONE_CLASS);
if (parsedLimit < originalClasses.length) {
labels.push(
compareMaskTargets?.[NONE_CLASS] ||
maskTargets?.[NONE_CLASS] ||
NONE_CLASS
);
matrix.push(originalMatrix[noneIndex]);
}
return { labels, matrix, colorscale };
}

Expand All @@ -1687,7 +1705,7 @@ function useActiveFilter(evaluation, compareEvaluation) {
const { _cls, kwargs } = stage;
if (_cls.endsWith("FilterLabels")) {
const [_, filter] = kwargs;
const filterEq = filter[1].$eq;
const filterEq = filter[1].$eq || [];
const [filterEqLeft, filterEqRight] = filterEq;
if (filterEqLeft === "$$this.label") {
return { type: "label", value: filterEqRight };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function EvaluationCard(props: EvaluationCardProps) {
}
/>
)}
{status && <Status status={status} />}
{status && <Status status={status} readOnly />}
</Stack>
{note && <EvaluationNotes notes={note} variant="overview" />}
</Card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import React from "react";
import { useTriggerEvent } from "./utils";

export default function Status(props: StatusProps) {
const { status, canEdit, setStatusEvent } = props;
const { status, canEdit, readOnly, setStatusEvent } = props;
const triggerEvent = useTriggerEvent();

if (canEdit) {
if (!readOnly) {
return (
<Select
sx={{
Expand All @@ -22,6 +22,12 @@ export default function Status(props: StatusProps) {
onChange={(e) => {
triggerEvent(setStatusEvent, { status: e.target.value });
}}
title={
canEdit
? ""
: "You do not have permission to update evaluation status"
}
disabled={!canEdit}
>
{STATUSES.map((status) => {
const color = COLOR_BY_STATUS[status];
Expand Down Expand Up @@ -63,7 +69,8 @@ export default function Status(props: StatusProps) {
type StatusProps = {
status?: string;
canEdit?: boolean;
setStatusEvent?: string;
readOnly?: boolean;
setStatusEvent: string;
};

const STATUS_LABELS = {
Expand Down
3 changes: 3 additions & 0 deletions app/packages/operators/src/CustomPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
import { Property } from "./types";
import { CustomPanelProps, useCustomPanelHooks } from "./useCustomPanelHooks";
import { useTrackEvent } from "@fiftyone/analytics";
import usePanelEvent from "./usePanelEvent";

export function CustomPanel(props: CustomPanelProps) {
const { panelId, dimensions, panelName, panelLabel, isModalPanel } = props;
const { height, width } = dimensions?.bounds || {};
const { count } = useActivePanelEventsCount(panelId);
const [_, setLoading] = usePanelLoading(panelId);
const triggerPanelEvent = usePanelEvent();

const {
handlePanelStateChange,
Expand All @@ -36,8 +38,9 @@
setPanelCloseEffect(() => {
clearUseKeyStores(panelId);
trackEvent("close_panel", { panel: panelName });
triggerPanelEvent(panelId, { operator: props.onUnLoad });
});
}, []);

Check warning on line 43 in app/packages/operators/src/CustomPanel.tsx

View workflow job for this annotation

GitHub Actions / lint / eslint

React Hook useEffect has missing dependencies: 'panelId', 'panelName', 'props.onUnLoad', 'setPanelCloseEffect', 'trackEvent', and 'triggerPanelEvent'. Either include them or remove the dependency array

useEffect(() => {
setLoading(count > 0);
Expand Down Expand Up @@ -102,7 +105,7 @@

useEffect(() => {
dimensions?.refresh();
}, []);

Check warning on line 108 in app/packages/operators/src/CustomPanel.tsx

View workflow job for this annotation

GitHub Actions / lint / eslint

React Hook useEffect has a missing dependency: 'dimensions'. Either include it or remove the dependency array

return children;
}
Expand Down
8 changes: 0 additions & 8 deletions app/packages/operators/src/useCustomPanelHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,6 @@ export function useCustomPanelHooks(props: CustomPanelProps): CustomPanelHooks {
triggerPanelEvent,
]);

useEffect(() => {
return () => {
if (props.onUnLoad) {
triggerPanelEvent(panelId, { operator: props.onUnLoad });
}
};
}, []); // eslint-disable-line react-hooks/exhaustive-deps

const handlePanelStateChangeOpDebounced = useMemo(() => {
return debounce(
(state, onChange, panelId) => {
Expand Down
Loading
Loading