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

Using PDM #37

Merged
merged 9 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
58 changes: 0 additions & 58 deletions ctdvis/widgets/directory_selection.py

This file was deleted.

34 changes: 34 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[project]
name = "ctdvis"
version = "1.0.0"
description = "Default template for PDM package"
authors = [
{name = "Johannes Johansson", email = "nodc@smhi.se"},
]
dependencies = [
"pandas>=2.2.2",
"bokeh==2.4.2",
"pyproj>=3.6.1",
"pyyaml>=6.0.1",
"matplotlib>=3.8.4",
"requests>=2.31.0",
"gsw>=3.6.17",
]
requires-python = ">=3.11"
readme = "README.md"
license = {text = "MIT"}

[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"


[tool.pdm]
distribution = true


[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-data]
mypkg = ["."]
10 changes: 0 additions & 10 deletions requirements.txt

This file was deleted.

13 changes: 0 additions & 13 deletions setup.cfg

This file was deleted.

42 changes: 0 additions & 42 deletions setup.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions ctdvis/datahandler.py → src/ctdvis/datahandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ def add_size_columns(self, q_params, mapper=None):
self[size_key] = np.vectorize(
set_scatter_size)(self[q_para].fillna(''))

def append(self, df):
new_df = pd.concat([self, df])
return Frame(new_df)


class DataHandler:
"""Handler of data formats.
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
Panel,
Tabs
)
# from bokeh.models.widgets import Select
# from bokeh.models.widgets import RangeSlider
# from bokeh.models.widgets import DataTable
# from bokeh.models.widgets import TableColumn
# from bokeh.models.layouts import TabPanel
# from bokeh.models.layouts import Tabs


from bokeh.plotting import figure, show, output_file
from bokeh.tile_providers import get_provider, Vendors
from bokeh.core.validation import silence
Expand Down
2 changes: 1 addition & 1 deletion ctdvis/utils.py → src/ctdvis/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@author: a002028
"""
from collections import Mapping
from collections.abc import Mapping
from datetime import datetime
from pyproj import CRS, transform
import numpy as np
Expand Down
File renamed without changes.
78 changes: 78 additions & 0 deletions src/ctdvis/widgets/directory_selection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/usr/bin/env python
# Copyright (c) 2022 SMHI, Swedish Meteorological and Hydrological Institute.
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
"""
Created on 2022-02-09 11:27

@author: johannes
"""
# from PyQt5.QtWidgets import QFileDialog, QApplication, QMessageBox
# from PyQt5.QtGui import QPixmap
# from PyQt5.QtCore import Qt

import tkinter as tk
from tkinter import filedialog
from tkinter import messagebox


# class DirectoryWindow(QFileDialog):
# """Dialog window for directory selection."""
#
# def __init__(self, folder=None):
# """Initiate."""
# super().__init__()
# self.folder = folder or 'C:/'
#
# def open_dialog(self, *args):
# """Set selected directory path."""
# path = self.getExistingDirectory(
# self, 'Select a directory', self.folder
# )
# if Path(path).is_dir():
# self.folder = path


# def old_get_folder_path_from_user():
# """Return the selected directory path.
#
# Opens up a diolog window.
# """
# app = QApplication(sys.argv) # noqa: F841
# dir_selector = DirectoryWindow()
# dir_selector.open_dialog()
# return dir_selector.folder
#
#
# def old_message_box(text, icon_path=None):
# """Return dialog window.
#
# Args:
# text: Text.
# picture_path: Path to file.
# """
# app = QApplication(sys.argv) # noqa: F841
# msgbox = QMessageBox()
# msgbox.setWindowTitle("Profile QC-tool")
# msgbox.setText(text)
# if icon_path:
# msgbox.setIconPixmap(QPixmap(icon_path))
# msgbox.setWindowFlags(Qt.WindowStaysOnTopHint)
# msgbox.exec_()


def get_folder_path_from_user():
try:
return filedialog.askdirectory()
except:
root = tk.Tk()
root.withdraw()
return filedialog.askdirectory()


def message_box(text, icon_path=None):
try:
messagebox.showinfo('Meddelande', text)
except:
root = tk.Tk()
root.withdraw()
messagebox.showinfo('Meddelande', text)
File renamed without changes.
Empty file added tests/__init__.py
Empty file.
Loading