mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-05 23:38:42 +08:00
Compatibility for numpy 2.0 (#3265)
* compat for numpy 2.0 * lint changes
This commit is contained in:
1 parent
9b3cbc79bf
commit
d6df39b70d
93 files changed
+104
-74
No files matched your search
@@ -16,6 +16,7 @@
|
||||
Code for deploying the built viewer folder to a server and handing versioning.
|
||||
We use the library sshconf (https://github.com/sorend/sshconf) for working with the ssh config file.
|
||||
"""
|
||||
|
||||
import json
|
||||
import subprocess
|
||||
from os.path import expanduser
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
""" Control panel for the viewer """
|
||||
"""Control panel for the viewer"""
|
||||
|
||||
from collections import defaultdict
|
||||
from typing import Callable, DefaultDict, List, Tuple, get_args
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
""" Utilities for generating custom gui elements in the viewer """
|
||||
"""Utilities for generating custom gui elements in the viewer"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
@@ -12,9 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""Path class
|
||||
"""
|
||||
|
||||
"""Path class"""
|
||||
|
||||
from typing import Tuple
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
""" This file contains the render state machine, which is responsible for deciding when to render the image """
|
||||
"""This file contains the render state machine, which is responsible for deciding when to render the image"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""Generic utility functions
|
||||
"""
|
||||
"""Generic utility functions"""
|
||||
|
||||
from typing import List, Optional, Tuple, Union
|
||||
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
""" Viewer GUI elements for the nerfstudio viewer """
|
||||
|
||||
"""Viewer GUI elements for the nerfstudio viewer"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -263,8 +262,7 @@ class ViewerParameter(ViewerElement[TValue], Generic[TValue]):
|
||||
self.gui_handle.on_update(lambda _: self.cb_hook(self))
|
||||
|
||||
@abstractmethod
|
||||
def _create_gui_handle(self, viser_server: ViserServer) -> None:
|
||||
...
|
||||
def _create_gui_handle(self, viser_server: ViserServer) -> None: ...
|
||||
|
||||
@property
|
||||
def value(self) -> TValue:
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
""" Manage the state of the viewer """
|
||||
"""Manage the state of the viewer"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import threading
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
|
||||
"""Code to interface with the `vis/` (the JS viewer)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
""" Viser is used for the nerfstudio viewer backend """
|
||||
|
||||
"""Viser is used for the nerfstudio viewer backend"""
|
||||
|
||||
from .message_api import GuiHandle as GuiHandle, GuiSelectHandle as GuiSelectHandle
|
||||
from .messages import NerfstudioMessage as NerfstudioMessage
|
||||
|
||||
@@ -13,10 +13,11 @@
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
""" Manages GUI communication.
|
||||
"""Manages GUI communication.
|
||||
|
||||
Should be almost identical to: https://github.com/brentyi/viser/blob/main/viser/_gui.py
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import dataclasses
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
""" This module contains the MessageApi class, which is the interface for sending messages to the Viewer"""
|
||||
|
||||
"""This module contains the MessageApi class, which is the interface for sending messages to the Viewer"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -274,8 +273,7 @@ class MessageApi(abc.ABC):
|
||||
options: List[TLiteralString],
|
||||
initial_value: Optional[TLiteralString] = None,
|
||||
hint: Optional[str] = None,
|
||||
) -> GuiSelectHandle[TLiteralString]:
|
||||
...
|
||||
) -> GuiSelectHandle[TLiteralString]: ...
|
||||
|
||||
@overload
|
||||
def add_gui_select(
|
||||
@@ -284,8 +282,7 @@ class MessageApi(abc.ABC):
|
||||
options: List[str],
|
||||
initial_value: Optional[str] = None,
|
||||
hint: Optional[str] = None,
|
||||
) -> GuiSelectHandle[str]:
|
||||
...
|
||||
) -> GuiSelectHandle[str]: ...
|
||||
|
||||
def add_gui_select(
|
||||
self,
|
||||
@@ -325,8 +322,7 @@ class MessageApi(abc.ABC):
|
||||
name: str,
|
||||
options: List[TLiteralString],
|
||||
initial_value: Optional[TLiteralString] = None,
|
||||
) -> GuiHandle[TLiteralString]:
|
||||
...
|
||||
) -> GuiHandle[TLiteralString]: ...
|
||||
|
||||
@overload
|
||||
def add_gui_button_group(
|
||||
@@ -334,8 +330,7 @@ class MessageApi(abc.ABC):
|
||||
name: str,
|
||||
options: List[str],
|
||||
initial_value: Optional[str] = None,
|
||||
) -> GuiHandle[str]:
|
||||
...
|
||||
) -> GuiHandle[str]: ...
|
||||
|
||||
def add_gui_button_group(
|
||||
self,
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
""" Core Viser Server """
|
||||
|
||||
"""Core Viser Server"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
Reference in new issue
Block a user