Browse Source

Remove numpy dependency

Signed-off-by: falkTX <falktx@falktx.com>
pull/2012/head
falkTX 6 months ago
parent
commit
e5ab114eef
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
3 changed files with 8 additions and 5 deletions
  1. +7
    -2
      source/frontend/carla_shared.py
  2. +0
    -1
      source/frontend/carla_widgets.py
  3. +1
    -2
      source/frontend/widgets/commondial.py

+ 7
- 2
source/frontend/carla_shared.py View File

@@ -9,7 +9,6 @@ import os
import sys import sys


from math import fmod, log10 from math import fmod, log10
import numpy as np


# ------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------
# Imports (Signal) # Imports (Signal)
@@ -965,7 +964,13 @@ def getPrefixSuffix(unit):
# ------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------


def strLim(value, digits = 5): def strLim(value, digits = 5):
result = np.format_float_positional(value, trim='-', fractional=False, precision=digits)
# np.format_float_positional(value, trim='-', fractional=False, precision=digits)
result = "%.5f" % value
if "." in result:
result = result.strip("0")
if result[-1] == ".":
result = result.removesuffix(".")

if len(result) > 9: if len(result) > 9:
return '{:.3e}'.format(value) return '{:.3e}'.format(value)
else: else:


+ 0
- 1
source/frontend/carla_widgets.py View File

@@ -6,7 +6,6 @@
# Imports (Global) # Imports (Global)


from abc import abstractmethod from abc import abstractmethod
import numpy as np


# ------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------
# Imports (PyQt) # Imports (PyQt)


+ 1
- 2
source/frontend/widgets/commondial.py View File

@@ -1,12 +1,11 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# SPDX-FileCopyrightText: 2011-2024 Filipe Coelho <falktx@falktx.com>
# SPDX-FileCopyrightText: 2011-2025 Filipe Coelho <falktx@falktx.com>
# SPDX-License-Identifier: GPL-2.0-or-later # SPDX-License-Identifier: GPL-2.0-or-later


# --------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------
# Imports (Global) # Imports (Global)


from math import isnan, log10 from math import isnan, log10
import numpy as np


from qt_compat import qt_config from qt_compat import qt_config




Loading…
Cancel
Save