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.1.0 to develop #5178

Merged
merged 46 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
bc9abe8
parallelize mask path decoding
sashankaryal Nov 19, 2024
209932b
set default retry delay to 500ms
sashankaryal Nov 20, 2024
c91d265
use custom fetch with linear backoff for mask path decoding
sashankaryal Nov 20, 2024
e991eab
retry image looker image.src with linear backoff
sashankaryal Nov 20, 2024
11fbcb0
remove debug logs
sashankaryal Nov 20, 2024
e73409b
fix tests
sashankaryal Nov 20, 2024
3f74b15
explicit default arg
sashankaryal Nov 20, 2024
dbbd0b6
set error: true preemptively
sashankaryal Nov 20, 2024
66e110c
add open modal operator
ritch Nov 20, 2024
47109b3
rename open_sample ops
ritch Nov 21, 2024
102847c
allow legacy orchestration
brimoor Nov 22, 2024
e9b089a
simplify warning
brimoor Nov 22, 2024
1b52f51
QP sidebar filters to active slice for group datasets (#5177)
benjaminpkane Nov 22, 2024
997bc69
Merge branch 'release/v1.1.0' of https://github.com/voxel51/fiftyone …
voxel51-bot Nov 22, 2024
09764f2
improve orc registration options and warning in oss
ritch Nov 22, 2024
5939efe
minor fixes embeddings and model evaluation panels CTA
imanjra Nov 22, 2024
f692b3a
fix disabled schedule button logic
ritch Nov 22, 2024
1b8709d
disabled split button theme-ing
ritch Nov 22, 2024
bdc3570
don't retry on 4xx error
sashankaryal Nov 22, 2024
632f140
fix foo.execute_operator() with delegation
swheaton Nov 22, 2024
d621680
keep it async to match before
swheaton Nov 22, 2024
2ede748
store delegated flag
brimoor Nov 22, 2024
dac2474
Retain browser setting for modal dynamic groups (#5149)
benjaminpkane Nov 22, 2024
611234d
Merge branch 'release/v1.1.0' of https://github.com/voxel51/fiftyone …
voxel51-bot Nov 22, 2024
be38d26
lint
brimoor Nov 22, 2024
488cb28
Merge pull request #5179 from voxel51/bugfix/panel-cta-im-x1
brimoor Nov 22, 2024
e204af7
Merge branch 'release/v1.1.0' of https://github.com/voxel51/fiftyone …
voxel51-bot Nov 22, 2024
7b079dc
Merge pull request #5176 from voxel51/legacy-orcs
brimoor Nov 22, 2024
2fdbb38
Merge branch 'release/v1.1.0' of https://github.com/voxel51/fiftyone …
voxel51-bot Nov 22, 2024
6608021
Merge pull request #5156 from voxel51/improv/mask-path
sashankaryal Nov 22, 2024
03c4e84
Merge pull request #5180 from voxel51/fix/do-from-sdk
brimoor Nov 23, 2024
5ad59de
don't require pipeline updates when setting output schema
brimoor Nov 22, 2024
4e0a5bb
updating tests
brimoor Nov 22, 2024
60f8a9a
Merge branch 'merge/release/v1.1.0' of https://github.com/voxel51/fif…
voxel51-bot Nov 23, 2024
5c4f9f9
Merge branch 'release/v1.1.0' of https://github.com/voxel51/fiftyone …
voxel51-bot Nov 23, 2024
99ee8af
Merge pull request #5181 from voxel51/fix/outputs-schema
brimoor Nov 23, 2024
bd748ab
Merge branch 'release/v1.1.0' of https://github.com/voxel51/fiftyone …
voxel51-bot Nov 23, 2024
93f4360
more helpful error when awaiting embeddings
brimoor Nov 23, 2024
7e52be8
fix typo
brimoor Nov 23, 2024
7a4899b
consistent tense
brimoor Nov 23, 2024
b26d1d9
Merge pull request #5168 from voxel51/feat/change-cur-sample
brimoor Nov 23, 2024
ae916df
Merge branch 'release/v1.1.0' of https://github.com/voxel51/fiftyone …
voxel51-bot Nov 23, 2024
767ecb9
Improve performance for Selection tree component (#5185)
lanzhenw Nov 24, 2024
3fc9d74
Merge branch 'release/v1.1.0' of https://github.com/voxel51/fiftyone …
voxel51-bot Nov 24, 2024
ee88926
Merge pull request #5182 from voxel51/embeddings-help
brimoor Nov 25, 2024
e62c1d1
Merge branch 'release/v1.1.0' of https://github.com/voxel51/fiftyone …
voxel51-bot Nov 25, 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
6 changes: 5 additions & 1 deletion app/packages/components/src/components/PanelCTA/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ function TypographyOrNode(props: TypographyProps) {
const { children, ...otherProps } = props;

if (typeof children === "string") {
return <Typography {...otherProps}>{children}</Typography>;
return (
<Typography sx={{ textAlign: "center" }} {...otherProps}>
{children}
</Typography>
);
}

if (React.isValidElement(children)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ export default function NativeModelEvaluationView(props) {
demoLabel="Upgrade to FiftyOne Teams to Evaluate Models"
description="Analyze and improve models collaboratively with your team"
docLink="https://docs.voxel51.com/user_guide/evaluation.html"
docCaption="Learn how to create model evaluation via code."
demoDocCaption="Not ready to upgrade yet? Learn how to create model evaluation via code."
docCaption="Learn how to evaluate models via code."
demoDocCaption="Not ready to upgrade yet? Learn how to evaluate models via code."
icon="ssid_chart"
Actions={() => {
return (
Expand Down
33 changes: 12 additions & 21 deletions app/packages/embeddings/src/Embeddings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,18 @@ export default function Embeddings({ containerHeight, dimensions }) {
containerStyle={selectorStyle}
/>
)}
{computeViz.isAvailable && (
<PlotOption
to={() => computeViz.prompt()}
title={"Compute visualization"}
>
<Add />
</PlotOption>
)}
<PlotOption
to={() => {
if (constants.IS_APP_MODE_FIFTYONE) {
setShowCTA(true);
} else {
computeViz.prompt();
}
}}
title={"Compute visualization"}
>
<Add />
</PlotOption>
{!plotSelection.selectionIsExternal && (
<PlotOption
to={plotSelection.clearSelection}
Expand Down Expand Up @@ -152,19 +156,6 @@ export default function Embeddings({ containerHeight, dimensions }) {
)}
<OperatorPlacements place={types.Places.EMBEDDINGS_ACTIONS} />
</div>
<MuiButton
startIcon={<Add />}
onClick={() => {
if (constants.IS_APP_MODE_FIFTYONE) {
setShowCTA(true);
} else {
computeViz.prompt();
}
}}
variant="contained"
>
Compute Embeddings
</MuiButton>
</Selectors>
{showPlot && (
<EmbeddingsPlot
Expand Down
20 changes: 17 additions & 3 deletions app/packages/operators/src/SplitButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
ListItemText,
Tooltip,
ButtonProps,
Box,
} from "@mui/material";
import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
import { onEnter } from "./utils";
Expand Down Expand Up @@ -128,6 +129,9 @@ export default function SplitButton({
key={option.id}
disabled={option.disabled}
selected={option.selected}
sx={{
cursor: option.onClick ? "pointer" : "default",
}}
onClick={() => handleSelect(option)}
>
<ListItemText
Expand All @@ -141,9 +145,19 @@ export default function SplitButton({
<PrimaryWithTag
label={option.choiceLabel || option.label}
tag={option.tag}
disabled={option.disabled || !option.onClick}
/>
}
secondary={option.description}
secondary={
<Box
sx={{
fontSize: "11px",
"& *": { fontSize: "inherit" },
}}
>
{option.description}
</Box>
}
/>
</MenuItem>
))}
Expand All @@ -158,13 +172,13 @@ export default function SplitButton({
);
}

function PrimaryWithTag({ label, tag }) {
function PrimaryWithTag({ label, tag, disabled }) {
const theme = useTheme();
const tagEl = tag ? (
<span
style={{
fontSize: "11px",
color: theme.custom.primarySoft,
color: disabled ? theme.text.secondary : theme.custom.primarySoft,
Comment on lines +175 to +181
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add TypeScript type definitions for PrimaryWithTag props

While the implementation is correct, adding proper TypeScript types would improve maintainability and type safety.

+ interface PrimaryWithTagProps {
+   label: string;
+   tag?: string;
+   disabled?: boolean;
+ }

- function PrimaryWithTag({ label, tag, disabled }) {
+ function PrimaryWithTag({ label, tag, disabled }: PrimaryWithTagProps) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function PrimaryWithTag({ label, tag, disabled }) {
const theme = useTheme();
const tagEl = tag ? (
<span
style={{
fontSize: "11px",
color: theme.custom.primarySoft,
color: disabled ? theme.text.secondary : theme.custom.primarySoft,
interface PrimaryWithTagProps {
label: string;
tag?: string;
disabled?: boolean;
}
function PrimaryWithTag({ label, tag, disabled }: PrimaryWithTagProps) {
const theme = useTheme();
const tagEl = tag ? (
<span
style={{
fontSize: "11px",
color: disabled ? theme.text.secondary : theme.custom.primarySoft,

marginLeft: "5px",
}}
>
Expand Down
45 changes: 36 additions & 9 deletions app/packages/operators/src/state.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { useAnalyticsInfo } from "@fiftyone/analytics";
import * as fos from "@fiftyone/state";
import { debounce } from "lodash";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import React, {
useCallback,
useEffect,
useMemo,
useRef,
useState,
} from "react";
import {
atom,
selector,
Expand Down Expand Up @@ -32,6 +38,7 @@ import {
import { OperatorPromptType, Places } from "./types";
import { OperatorExecutorOptions } from "./types-internal";
import { ValidationContext } from "./validation";
import { Markdown } from "@fiftyone/components";

export const promptingOperatorState = atom({
key: "promptingOperator",
Expand Down Expand Up @@ -231,8 +238,8 @@ function useExecutionOptions(operatorURI, ctx, isRemote) {
export type OperatorExecutionOption = {
label: string;
id: string;
description: string;
onClick: () => void;
description: string | React.ReactNode;
onClick?: () => void;
isDelegated: boolean;
choiceLabel?: string;
tag?: string;
Expand All @@ -251,7 +258,7 @@ const useOperatorPromptSubmitOptions = (
const persistUnderKey = `operator-prompt-${operatorURI}`;
const availableOrchestrators =
execDetails.executionOptions?.availableOrchestrators || [];
const hasAvailableOrchestators = availableOrchestrators.length > 0;
const hasAvailableOrchestrators = availableOrchestrators.length > 0;
const executionOptions = execDetails.executionOptions || {};
const defaultToExecute = executionOptions.allowDelegatedExecution
? !executionOptions.defaultChoiceToDelegated
Expand Down Expand Up @@ -287,7 +294,7 @@ const useOperatorPromptSubmitOptions = (
label: "Schedule",
id: "schedule",
default: defaultToSchedule,
description: "Run this operation on your compute cluster",
description: "Run this operation in the background",
onSelect() {
setSelectedID("schedule");
},
Expand All @@ -300,7 +307,7 @@ const useOperatorPromptSubmitOptions = (

if (
executionOptions.allowDelegatedExecution &&
hasAvailableOrchestators &&
hasAvailableOrchestrators &&
executionOptions.orchestratorRegistrationEnabled
) {
for (let orc of execDetails.executionOptions.availableOrchestrators) {
Expand All @@ -321,6 +328,25 @@ const useOperatorPromptSubmitOptions = (
isDelegated: true,
});
}
} else if (
executionOptions.allowDelegatedExecution &&
executionOptions.allowImmediateExecution &&
executionOptions.orchestratorRegistrationEnabled &&
!hasAvailableOrchestrators
) {
const markdownDesc = React.createElement(
Markdown,
null,
"[Learn how](https://docs.voxel51.com/plugins/using_plugins.html#delegated-operations) to run this operation in the background"
);
options.push({
label: "Schedule",
choiceLabel: `Schedule`,
tag: "NOT AVAILABLE",
id: "disabled-schedule",
description: markdownDesc,
isDelegated: true,
});
}

// sort options so that the default is always the first in the list
Expand Down Expand Up @@ -366,10 +392,11 @@ const useOperatorPromptSubmitOptions = (
if (selectedOption) selectedOption.selected = true;
const showWarning =
executionOptions.orchestratorRegistrationEnabled &&
!hasAvailableOrchestators &&
!hasAvailableOrchestrators &&
!executionOptions.allowImmediateExecution;
const warningMessage =
"There are no available orchestrators to schedule this operation. Please contact your administrator to add an orchestrator.";
const warningStr =
"This operation requires [delegated execution](https://docs.voxel51.com/plugins/using_plugins.html#delegated-operations)";
const warningMessage = React.createElement(Markdown, null, warningStr);

return {
showWarning,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions app/packages/state/src/hooks/useSetModalState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { CallbackInterface, RecoilState } from "recoil";

import { useRelayEnvironment } from "react-relay";
import { useRecoilCallback } from "recoil";
import { dynamicGroupsViewMode } from "../recoil";
import * as atoms from "../recoil/atoms";
import * as filterAtoms from "../recoil/filters";
import * as groupAtoms from "../recoil/groups";
Expand Down Expand Up @@ -45,8 +44,6 @@ export default () => {
];
}),

[dynamicGroupsViewMode(true), dynamicGroupsViewMode(false)],

[atoms.cropToContent(true), atoms.cropToContent(false)],
[atoms.sortFilterResults(true), atoms.sortFilterResults(false)],
[groupAtoms.groupStatistics(true), groupAtoms.groupStatistics(false)],
Expand Down
36 changes: 31 additions & 5 deletions app/packages/state/src/recoil/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
mediaFieldsFragment,
mediaFieldsFragment$key,
} from "@fiftyone/relay";
import { atomFamily, selector, selectorFamily } from "recoil";
import { DefaultValue, atomFamily, selector, selectorFamily } from "recoil";
import { getBrowserStorageEffectForKey } from "./customEffects";
import { datasetSampleCount } from "./dataset";
import { fieldPaths } from "./schema";
Expand Down Expand Up @@ -55,17 +55,43 @@ export const selectedMediaField = selectorFamily<string, boolean>({
set(selectedMediaFieldAtomFamily(modal), value),
});

export const dynamicGroupsViewMode = atomFamily<
"carousel" | "pagination" | "video",
export const dynamicGroupsViewModeStore = atomFamily<
"carousel" | "pagination" | "video" | null,
boolean
>({
key: "dynamicGroupsViewMode",
default: "pagination",
key: "dynamicGroupsViewModeStore",
default: null,
effects: (modal) => [
getBrowserStorageEffectForKey(`dynamicGroupsViewMode-${modal}`),
],
});

export const dynamicGroupsViewMode = selectorFamily({
key: "dynamicGroupsViewMode",
get:
(modal: boolean) =>
({ get }) => {
const value = get(dynamicGroupsViewModeStore(modal));

if (!value) {
return modal
? get(dynamicGroupsViewModeStore(false)) ?? "pagination"
: "pagination";
}

return value;
},
set:
(modal: boolean) =>
({ reset, set }, newValue) => {
const instance = dynamicGroupsViewModeStore(modal);

newValue instanceof DefaultValue
? reset(instance)
: set(instance, newValue);
},
});

export const isLargeVideo = selector<boolean>({
key: "isLargeVideo",
get: ({ get }) => {
Expand Down
2 changes: 2 additions & 0 deletions app/packages/state/src/recoil/queryPerformance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { graphQLSelectorFamily } from "recoil-relay";
import type { ResponseFrom } from "../utils";
import { config } from "./config";
import { getBrowserStorageEffectForKey } from "./customEffects";
import { groupSlice } from "./groups";
import { isLabelPath } from "./labels";
import { RelayEnvironmentKey } from "./relay";
import * as schemaAtoms from "./schema";
Expand All @@ -34,6 +35,7 @@ export const lightningQuery = graphQLSelectorFamily<
input: {
dataset: get(datasetName),
paths,
slice: get(groupSlice),
},
};
},
Expand Down
1 change: 1 addition & 0 deletions app/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ input LabelTagColorInput {
input LightningInput {
dataset: String!
paths: [LightningPathInput!]!
slice: String = null
}

input LightningPathInput {
Expand Down
Binary file not shown.
45 changes: 2 additions & 43 deletions docs/source/plugins/developing_plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -992,9 +992,8 @@ contains the following properties:
instance that you can use to read and write the :ref:`state <panel-state>`
and :ref:`data <panel-data>` of the current panel, if the operator was
invoked from a panel
- `ctx.delegated` - whether delegated execution has been forced for the
operation
- `ctx.requesting_delegated_execution` - whether delegated execution has been
- `ctx.delegated` - whether the operation was delegated
- `ctx.requesting_delegated_execution` - whether delegated execution was
requested for the operation
- `ctx.delegation_target` - the orchestrator to which the operation should be
delegated, if applicable
Expand Down Expand Up @@ -1248,46 +1247,6 @@ of the current view:
to specify the available execution options as described in the previous
section.

Alternatively, you could simply ask the user to decide:

.. code-block:: python
:linenos:

def resolve_input(self, ctx):
delegate = ctx.params.get("delegate", None)

if delegate:
description = "Uncheck this box to execute the operation immediately"
else:
description = "Check this box to delegate execution of this task"

inputs.bool(
"delegate",
label="Delegate execution?",
description=description,
view=types.CheckboxView(),
)

if delegate:
inputs.view(
"notice",
types.Notice(
label=(
"You've chosen delegated execution. Note that you must "
"have a delegated operation service running in order for "
"this task to be processed. See "
"https://docs.voxel51.com/plugins/index.html#operators "
"for more information"
)
),
)

def resolve_delegation(self, ctx):
return ctx.params.get("delegate", None)

.. image:: /images/plugins/operators/operator-user-delegation.png
:align: center

.. _operator-reporting-progress:

Reporting progress
Expand Down
Loading
Loading