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

Add test for single value comparison #128

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ odmltables/gui/graphics/*.dvi
odmltables/gui/graphics/*.ps
odmltables/gui/graphics/*.txt
odmltables/gui/graphics/*.tex.backup
odmltables/gui/testfiles/*
src/odmltables/gui/testfiles/*
doc/build/*
doc/_build/*
doc/requirements*.rst
Expand Down
31 changes: 15 additions & 16 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,17 @@
# serve to show the default.

import sys
import glob
import subprocess
import os

import tomllib

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('../src'))
sys.path.insert(0, os.path.abspath('../../python-odml/'))
sys.path.insert(0, os.path.abspath('../odmltables'))
sys.path.insert(0, os.path.abspath('../src/odmltables'))
sys.path.insert(0, os.path.abspath('..'))

# installing current odMLtables version
Expand All @@ -33,25 +32,25 @@
output, error = process.communicate()

import odmltables

VERSION = odmltables.VERSION

# reformatting requirements files to be automatically included in docu
requirement_files = glob.glob('../requirements*.txt')
for requirement_file in requirement_files:
with open(requirement_file, 'r') as f:
lines = f.readlines()
# listify and increase readability
for line_id in range(len(lines)):
lines[line_id] = '* ' + lines[line_id]
lines[line_id] = lines[line_id].replace(';', ' in case of ')
new_filename = f'{os.path.splitext(os.path.basename(requirement_file))[0]}.rst'
with open(new_filename, 'w+') as f:
f.writelines(lines)


with open("../pyproject.toml", "rb") as f:
data = tomllib.load(f)

def format_dependencies(dependency_list):
# format a list of dependencies into a block text list
formatted_dependencies = '\n* '.join(dependency_list).replace(';', ' in case of ')
return formatted_dependencies

dependencies = data["project"]["dependencies"]
with open('requirements.rst', 'w+') as f:
f.write(format_dependencies(dependencies))

for option, optional_dependencies in data["project"]["optional-dependencies"].items():
with open(f'requirements_{option}.rst', 'w+') as f:
f.write(format_dependencies(optional_dependencies))


# -- General configuration ------------------------------------------------
Expand Down
21 changes: 12 additions & 9 deletions doc/environment.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: odmltables
channels:
- conda-forge
- free
- anaconda
dependencies:
- python=3.7
- setuptools
- snowballstemmer
- sphinx
- sphinx_rtd_theme
- pip
- pip:
- odml
- sphinx-rtd-theme
- python ==3.11
- setuptools
- snowballstemmer
- sphinx
- sphinx_rtd_theme
- pip
- pip:
- odml
3 changes: 2 additions & 1 deletion doc/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ version `1.0 <https://github.com/G-Node/odml-terminologies/blob/master/v1.0/odml
the `G-Node <http://www.g-node.org/projects/odml>`_.


In addition to the detailed step-by-step instructions presented here, there are also two **interactive tutorials** available as `jupyter notebooks`_. Both tutorials can be directly executed using binder_ or run locally from the odmltables sources (:any:`tutorials/tutorial-1_scenarios/demo_scenarios.ipynb`) folder. The first notebook (|notebook1|) is giving a quick overview on how odMLtables can be used in a metadata workflow by presenting a number of small application scenarios. The second notebook (|notebook2|) shows the usage of odMLtables for handling large metadata collections and is based on two published experimental datasets.
In addition to the detailed step-by-step instructions presented here, there are also two **interactive tutorials** available as `jupyter notebooks`_. Both tutorials can be directly executed using binder_ or run locally from the odmltables `tutorial folder`_. The first notebook (|notebook1|) is giving a quick overview on how odMLtables can be used in a metadata workflow by presenting a number of small application scenarios. The second notebook (|notebook2|) shows the usage of odMLtables for handling large metadata collections and is based on two published experimental datasets.

.. _binder: https://mybinder.org/
.. _jupyter notebooks: http://jupyter.org/
.. _tutorial folder: https://github.com/INM-6/python-odmltables/tree/master/tutorials

.. |notebook1| image:: https://mybinder.org/badge.svg
:target: https://mybinder.org/v2/gh/inm-6/python-odmltables/master?filepath=tutorials%2Ftutorial-1_scenarios%2Fdemo_scenarios.ipynb
Expand Down
1 change: 0 additions & 1 deletion odmltables/VERSION.txt

This file was deleted.

79 changes: 79 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
[project]
name = "odmltables"
version = "1.0.1dev"
authors = [
{name = "odMLtables authors and contributors"},
{email = "[email protected]"}
]
description = "Interface to convert odML structures to and from table-like representations"
readme = "README.rst"
requires-python = ">=3.6"
license = {text = "BSD 3-Clause License"}
keywords = ["odml", "excel", "metadata management"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Topic :: Scientific/Engineering",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
]

dependencies = [
"xlrd >= 0.9.4",
"xlwt >= 1.0.0",
"numpy >= 1.8.2",
"quantities >= 0.10.1",
"odml >= 1.4.2",
"future >= 0.16.0",
"argparse >= 1.0.0",
]

[project.urls]
documentation = "http://odmltables.readthedocs.io/"
repository = "https://github.com/INM-6/python-odmltables"
download = "http://pypi.python.org/pypi/odmltables"


[build-system]
requires = ["setuptools>=62.0"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
include-package-data = true

[tool.setuptools.package-data]
odmltables = ["gui/graphics/*", "logo/*"]

[tool.pytest.ini_options]
minversion = "7.0"
addopts = "-ra -q"
testpaths = [
"tests",
"integration",
]
pythonpath = [
"src"
]

[project.gui-scripts]
odmltables = "odmltables.gui.main:parse_args"

[project.optional-dependencies]

doc = [
"numpydoc>=0.5.0",
"sphinx>=1.2.2",
]

gui = ["PyQt5>=5.0.0"]

test = ["pytest>=3.0.0"]
8 changes: 0 additions & 8 deletions requirements.txt

This file was deleted.

2 changes: 0 additions & 2 deletions requirements_doc.txt

This file was deleted.

1 change: 0 additions & 1 deletion requirements_gui.txt

This file was deleted.

1 change: 0 additions & 1 deletion requirements_test.txt

This file was deleted.

2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

69 changes: 0 additions & 69 deletions setup.py

This file was deleted.

File renamed without changes.
14 changes: 4 additions & 10 deletions odmltables/__init__.py → src/odmltables/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import os.path

with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'VERSION.txt')) as version_file:
VERSION = version_file.read().strip()

import importlib.metadata
# this need to be at the begining because some sub module will need the version
__version__ = importlib.metadata.version("odmltables")
VERSION = __version__

# -*- coding: utf-8 -*-
"""
Expand All @@ -15,9 +14,4 @@
.. autoclass:: odmltables.compare_section_csv_table.CompareSectionCsvTable
"""


from odmltables.odml_table import OdmlTable
from odmltables.odml_csv_table import OdmlCsvTable
from odmltables.odml_xls_table import OdmlXlsTable
from odmltables.compare_section_csv_table import CompareSectionCsvTable
from odmltables.compare_section_xls_table import CompareSectionXlsTable
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
import subprocess

from PyQt5.QtWidgets import (QVBoxLayout, QHBoxLayout, QMessageBox,
QLineEdit, QPushButton, QLabel, QGroupBox,
QGridLayout, QTreeWidget, QTreeWidgetItem,
QToolButton, QFileDialog, QCheckBox, QComboBox,
QFrame, QSizePolicy, QRadioButton)
QLineEdit, QPushButton, QLabel, QGroupBox,
QGridLayout, QTreeWidget, QTreeWidgetItem,
QToolButton, QFileDialog, QCheckBox, QRadioButton)

from PyQt5.QtCore import Qt

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import PyQt5.QtGui as Qtg

from .pageutils import QIWizardPage, clearLayout, get_property, get_rgb, shorten_path
from odmltables import odml_table, odml_xls_table, odml_csv_table, xls_style
from .. import odml_csv_table, odml_xls_table, xls_style, odml_table


class LoadFilePage(QIWizardPage):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from PyQt5.QtCore import Qt
import PyQt5.QtWidgets as Qtw

from odmltables import odml_table
from .. import odml_table
from .pageutils import QIWizardPage, clearLayout, shorten_path


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from PyQt5.QtCore import Qt

import odml
from odmltables import odml_table, odml_xls_table, odml_csv_table, xls_style
from .. import odml_xls_table, odml_table
from .pageutils import QIWizardPage, clearLayout, shorten_path

mandatory_headers = ['Path to Section',
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
"""
Created on Tue Jan 26 12:57:46 2016

@author: zehl
@author: Lyuba Zehl, Julia Sprenger
"""

import datetime
import os
import sys
import traceback
from importlib.resources import files, as_file

from PyQt5 import QtCore, QtWidgets, QtGui

Expand Down Expand Up @@ -149,13 +150,10 @@ def initUI(self):
icon = QtWidgets.QLabel()
# icon.setGeometry(10, 10, 4, 100)
logo_filename = "odMLtables_100x100.png"
logo_dirs = [os.path.join(os.path.dirname(__file__), '..', '..', 'logo'),
os.path.join(sys.prefix, 'share/pixmaps')]
for logo_dir in logo_dirs:
filepath = os.path.join(logo_dir, logo_filename)
logo_dir_object = files('odmltables.logo').joinpath(logo_filename)
with as_file(logo_dir_object) as filepath:
if os.path.exists(filepath):
icon.setPixmap(QtGui.QPixmap(filepath))

icon.setPixmap(QtGui.QPixmap(str(filepath)))

grid.addWidget(self.convertbutton, 0, 0, 1, 2, QtCore.Qt.AlignCenter)
grid.addWidget(self.comparebutton, 1, 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import PyQt5.QtWidgets as Qtw
from PyQt5.QtCore import QSize, Qt

from odmltables import odml_table, odml_xls_table, odml_csv_table, xls_style
from .. import odml_table
from .pageutils import QIWizardPage, shorten_path
from .wizutils import get_graphic_path

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading