Skip to content

Commit

Permalink
change default max ram value
Browse files Browse the repository at this point in the history
  • Loading branch information
muddymudskipper committed Jun 28, 2024
1 parent 1fadca3 commit 98a5751
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](https://semver.org/)

## [Unreleased]

### Changed

- default value for "Maximum RAM percentage" parameter changed from 15 to 20

## [1.0.0alpha2] 2024-06-28

### Added

- added "Annotate inferred axioms" and "Exclude duplicate axioms" parameters in Reason plugin
- added "Maximum RAM percentage" parameter in Reason and Validate plugins
- "Annotate inferred axioms" and "Exclude duplicate axioms" parameters in Reason plugin
- "Maximum RAM percentage" parameter in Reason and Validate plugins

### Changed

- Axiom generators are now not advanced parameters
- axiom generators are now not advanced parameters

## [1.0.0alpha1] 2024-06-27

Expand Down
5 changes: 3 additions & 2 deletions cmem_plugin_reason/plugin_reason.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from cmem_plugin_base.dataintegration.utils import setup_cmempy_user_access

from cmem_plugin_reason.utils import (
MAX_RAM_PERCENTAGE_DEFAULT,
MAX_RAM_PERCENTAGE_PARAMETER,
ONTOLOGY_GRAPH_IRI_PARAMETER,
REASONER_PARAMETER,
Expand Down Expand Up @@ -59,7 +60,7 @@
name="result_graph_iri",
label="Result graph IRI",
description="The IRI of the output graph for the reasoning result. ⚠️ Existing graph "
"will be overwritten!",
"will be overwritten.",
),
PluginParameter(
param_type=BoolParameterType(),
Expand Down Expand Up @@ -204,7 +205,7 @@ def __init__( # noqa: PLR0913
sub_object_property: bool = False,
exclude_duplicate_axioms: bool = True,
annotate_inferred_axioms: bool = False,
max_ram_percentage: int = 15,
max_ram_percentage: int = MAX_RAM_PERCENTAGE_DEFAULT,
) -> None:
"""Init"""
self.axioms = {
Expand Down
6 changes: 4 additions & 2 deletions cmem_plugin_reason/plugin_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from pathvalidate import validate_filename

from cmem_plugin_reason.utils import (
MAX_RAM_PERCENTAGE_DEFAULT,
MAX_RAM_PERCENTAGE_PARAMETER,
ONTOLOGY_GRAPH_IRI_PARAMETER,
REASONER_PARAMETER,
Expand Down Expand Up @@ -63,7 +64,8 @@
param_type=StringParameterType(),
name="output_graph_iri",
label="Output graph IRI",
description="The IRI of the output graph for the inconsistency validation.",
description="The IRI of the output graph for the inconsistency validation. ⚠️ Existing "
"graph will be overwritten.",
),
PluginParameter(
param_type=StringParameterType(),
Expand Down Expand Up @@ -94,7 +96,7 @@ def __init__( # noqa: PLR0913
write_md: bool = False,
md_filename: str = "",
stop_at_inconsistencies: bool = False,
max_ram_percentage: int = 15,
max_ram_percentage: int = MAX_RAM_PERCENTAGE_DEFAULT,
) -> None:
errors = ""
if not validators.url(ontology_graph_iri):
Expand Down
14 changes: 6 additions & 8 deletions cmem_plugin_reason/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
import unicodedata
from collections import OrderedDict
from pathlib import Path
from xml.etree.ElementTree import (
Element,
SubElement,
tostring,
)
from xml.etree.ElementTree import Element, SubElement, tostring

from cmem.cmempy.dp.proxy.graph import get_graph_import_tree, post_streamed
from cmem_plugin_base.dataintegration.description import PluginParameter
Expand All @@ -32,6 +28,8 @@
}
)

MAX_RAM_PERCENTAGE_DEFAULT = 20

ONTOLOGY_GRAPH_IRI_PARAMETER = PluginParameter(
param_type=GraphParameterType(classes=["http://www.w3.org/2002/07/owl#Ontology"]),
name="ontology_graph_iri",
Expand All @@ -51,9 +49,9 @@
param_type=IntParameterType(),
name="max_ram_percentage",
label="Maximum RAM Percentage",
description="""Maximum heap size for the Java virtual machine running the reasoning process.
⚠️ Setting the percentage too high may result in an out of memory error.""",
default_value=15,
description="Maximum heap size for the Java virtual machine in the DI container running the "
"reasoning process. ⚠️ Setting the percentage too high may result in an out of memory error.",
default_value=MAX_RAM_PERCENTAGE_DEFAULT,
advanced=True,
)

Expand Down

0 comments on commit 98a5751

Please sign in to comment.