Skip to content

Commit

Permalink
Pull request #223: moving request into methods to simply hnx import
Browse files Browse the repository at this point in the history
Merge in HYP/hypernetx from hotfix/issue.168 to master

* commit '5b42c630df348f2ea17f86b8c5f04e9db0c6d840':
  bump: version 2.3.11 → 2.3.12
  Precommit fixes
  moving request into methods to simply hnx import
  • Loading branch information
brendapraggastis authored and ryandanehy committed Jan 31, 2025
2 parents 7c827b4 + 5b42c63 commit 17484bf
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .cz.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.commitizen]
name = "cz_conventional_commits"
version = "2.3.11"
version = "2.3.12"
version_provider = "poetry"
version_files = [
"pyproject.toml",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import os


__version__ = "2.3.11"
__version__ = "2.3.12"


# If extensions (or modules to document with autodoc) are in another directory,
Expand Down
2 changes: 1 addition & 1 deletion hypernetx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
from hypernetx.utils import *
from hypernetx.utils.toys import *

__version__ = "2.3.11"
__version__ = "2.3.12"
13 changes: 10 additions & 3 deletions hypernetx/hif.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
from .exception import HyperNetXError

schema_url = "https://raw.githubusercontent.com/pszufe/HIF_validators/main/schemas/hif_schema_v0.1.0.json"
resp = requests.get(schema_url)
schema = json.loads(resp.text)
validator = fastjsonschema.compile(schema)


def normalize_dataframe(df):
Expand Down Expand Up @@ -62,6 +59,11 @@ def to_hif(hg, filename=None, network_type="undirected", metadata=None):
hif : dict
format is defined by HIF schema
"""

resp = requests.get(schema_url)
schema = json.loads(resp.text)
validator = fastjsonschema.compile(schema)

hyp_objs = ["nodes", "edges", "incidences"]
defaults = {
part: dict(getattr(hg, part).property_store._defaults) for part in hyp_objs
Expand Down Expand Up @@ -130,6 +132,11 @@ def from_hif(hif=None, filename=None):
hnx.Hypergraph
"""

resp = requests.get(schema_url)
schema = json.loads(resp.text)
validator = fastjsonschema.compile(schema)

if hif is not None:
try:
validator(hif)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "hypernetx"
version = "2.3.11"
version = "2.3.12"
description = "HyperNetX is a Python library for the creation and study of hypergraphs."
authors = ["Brenda Praggastis <[email protected]>", "Dustin Arendt <[email protected]>",
"Sinan Aksoy <[email protected]>", "Emilie Purvine <[email protected]>",
Expand Down

0 comments on commit 17484bf

Please sign in to comment.