Skip to content

Commit

Permalink
publish v3.0.0 (#213)
Browse files Browse the repository at this point in the history
* Add Shubhangi as contributor on Zenodo, bump Zenodo version

* Fix vulnerability to CVE-2023-25399

* Bump ConFlowGen version as it is used by setup.py / pip, add Shubhangi as contributor in the docstring

* Fix qodana issues

* add installation of parameterized to CI
  • Loading branch information
1kastner authored Aug 20, 2024
1 parent 147c40e commit 7969f3a
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/installation-from-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
conda info
conda update conda
conda info
conda create -n test-install-conflowgen -c conda-forge conflowgen pytest
conda create -n test-install-conflowgen -c conda-forge conflowgen pytest parameterized
- name: Prepare tests
run: |
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
conda update conda
conda info
conda activate base
conda create -n test-install-conflowgen -c conda-forge conflowgen pytest
conda create -n test-install-conflowgen -c conda-forge conflowgen pytest parameterized
- name: Run tests
run: |
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:

- name: Install ConFlowGen
run: |
python -m pip install conflowgen pytest
python -m pip install conflowgen pytest parameterized
python -m pip show --verbose conflowgen
- name: Run tests
Expand Down
7 changes: 6 additions & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ authors:
email: ole.grasse@tuhh.de
affiliation: Hamburg University of Technology (TUHH), Institute of Maritime Logistics
orcid: 'https://orcid.org/0000-0003-1982-9436'
version: 2.1.1
- given-names: Shubhangi
family-names: Gupta
email: shubhangi.gupta@tuhh.de
affiliation: Hamburg University of Technology (TUHH), Institute of Maritime Logistics
orcid: 'https://orcid.org/0009-0003-3574-2899'
version: 3.0.0
repository-code: "https://github.com/1kastner/conflowgen"
keywords:
- logistics
Expand Down
2 changes: 1 addition & 1 deletion conflowgen/analyses/abstract_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def _restrict_container_picked_up_by_vehicle_type(
if container_picked_up_by_vehicle_type == "scheduled vehicles":
container_picked_up_by_vehicle_type = ModeOfTransport.get_scheduled_vehicles()
list_of_vehicle_types = container_picked_up_by_vehicle_type
if hashable(container_picked_up_by_vehicle_type) \
elif hashable(container_picked_up_by_vehicle_type) \
and container_picked_up_by_vehicle_type in set(ModeOfTransport):
selected_containers = selected_containers.where(
Container.picked_up_by == container_picked_up_by_vehicle_type
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import logging
import typing

import matplotlib.figure
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -36,7 +35,6 @@ def __init__(self):

def get_report_as_text(
self,
vehicle_types: ModeOfTransport | str | typing.Collection = "scheduled vehicles",
**kwargs
) -> str:
"""
Expand Down Expand Up @@ -99,7 +97,10 @@ def _get_analysis(self, kwargs: dict) -> (list, list):

return plain_table, vehicle_types

def get_report_as_graph(self, **kwargs) -> matplotlib.figure.Figure:
def get_report_as_graph(
self,
**kwargs
) -> matplotlib.figure.Figure:
"""
Keyword Args:
vehicle_types (typing.Collection[ModeOfTransport]): A collection of vehicle types, e.g., passed as a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def _convert_table_to_pandas_dataframe(
# extract data from sql database
data = list(model.select().dicts())

if type(model) == ModelSelect: # pylint: disable=unidiomatic-typecheck # TODO: check if isinstance works
if isinstance(model, ModelSelect):
model = model.model

foreign_keys_to_resolve = {}
Expand Down
4 changes: 2 additions & 2 deletions conflowgen/metadata.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
__version__ = "2.1.1"
__version__ = "3.0.0"
__license__ = "MIT"
__description__ = """
A generator for synthetic container flows at maritime container terminals with a focus on yard operations
"""

__author__ = "Marvin Kastner and Ole Grasse"
__author__ = "Marvin Kastner, Ole Grasse, and Shubhangi Gupta"
__maintainer__ = "Marvin Kastner"
__email__ = "marvin.kastner@tuhh.de"
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
database_names = ["demo_continental_gateway", "demo_deham_cta", "demo_poc"] # List of database names to download
sqlite_databases_directory = "notebooks/data/prepared_dbs/"
os.system("echo 'Current directory:'")
os.system("pwd") # Print current directory; we expect to be in the docs folder
os.system("pwd") # Print current directory; we expect to be in the docs folder
os.makedirs(sqlite_databases_directory, exist_ok=True) # Create the destination folder if it doesn't exist
for database_name in database_names:
os.system(f'echo "Fetching {database_name}"')
Expand Down
29 changes: 29 additions & 0 deletions qodana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#-------------------------------------------------------------------------------#
# Qodana analysis is configured by qodana.yaml file #
# https://www.jetbrains.com/help/qodana/qodana-yaml.html #
#-------------------------------------------------------------------------------#
version: "1.0"

#Specify inspection profile for code analysis
profile:
name: qodana.starter

#Enable inspections
#include:
# - name: <SomeEnabledInspectionId>

#Disable inspections
#exclude:
# - name: <SomeDisabledInspectionId>
# paths:
# - <path/where/not/run/inspection>

#Execute shell command before Qodana execution (Applied in CI/CD pipeline)
#bootstrap: sh ./prepare-qodana.sh

#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline)
#plugins:
# - id: <plugin.id> #(plugin id can be found at https://plugins.jetbrains.com)

#Specify Qodana linter for analysis (Applied in CI/CD pipeline)
linter: jetbrains/qodana-<linter>:latest
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
python_requires='>=3.8',
install_requires=[
# working with distributions and statistics
'scipy', # used for, e.g., the lognorm distribution
"scipy >=1.10.0-rc1", # used for, e.g., the lognorm distribution, version fixed due to CVE-2023-25399

# data export
'numpy', # used in combination with pandas for column types
Expand Down Expand Up @@ -53,6 +53,7 @@
'parameterized', # for parameterized testing
'seaborn', # some visuals in unittests are generated by seaborn
'nbconvert', # used to run tests in Jupyter notebooks, see ./test/notebooks/test_run_notebooks.py
'nbformat', # used to run tests in Jupyter notebooks

# build documentation
'sphinx >=6.2', # build the documentation - restrict version to improve pip version resolution
Expand Down

0 comments on commit 7969f3a

Please sign in to comment.