# Path: loompy/utils.py
# def compare_loom_spec_version(f: HDF5File, v: str) -> int:
# 	vf = int("".join(get_loom_spec_version(f).split(".")))
# 	vc = int("".join(v.split(".")))
# 	if vf == vc:
# 		return 0
# 	if vf > vc:
# 		return 1
# 	return -1


from typing import Dict, List, Iterable, Tuple, Any, Iterator
from .utils import compare_loom_spec_version
import scipy.sparse as sparse
import numpy as np
import loompy
import warnings
	import h5py

	def __getattr__(self, name: str) -> np.ndarray:
		try:
			return self.__dict__["storage"][name]
		except KeyError:
			if self.f is not None:
				if loompy.compare_loom_spec_version(self.f, "3.0.0") < 0:
					if name in self.f.attrs:
						val = self.f.attrs[name]
					else:
						raise AttributeError(f"File has no global attribute '{name}'")
				else:
					if name in self.f["attrs"]:
						val = self.f["attrs"][name]
					else:
						raise AttributeError(f"File has no global attribute '{name}'")
				materialized = loompy.materialize_attr_values(val)
				self.__dict__["storage"][name] = materialized
				return materialized

	def __setitem__(self, name: str, val: Any) -> None:
		return self.__setattr__(name, val)

	def __setattr__(self, name: str, val: Any) -> None:
		if name.startswith("!"):
			super(GlobalAttributeManager, self).__setattr__(name[1:], val)
		elif "/" in name:
			raise KeyError("Attribute name cannot contain slash (/)")
		else:
			if self.f is not None:

# Path: loompy/utils.py
# def compare_loom_spec_version(f: HDF5File, v: str) -> int:
# 	vf = int("".join(get_loom_spec_version(f).split(".")))
# 	vc = int("".join(v.split(".")))
# 	if vf == vc:
# 		return 0
# 	if vf > vc:
# 		return 1
# 	return -1


# Path: loompy/global_attribute_manager.py
from typing import Dict, List, Iterable, Tuple, Any, Iterator
from .utils import compare_loom_spec_version
import scipy.sparse as sparse
import numpy as np
import loompy
import warnings
	import h5py


	def __getattr__(self, name: str) -> np.ndarray:
		try:
			return self.__dict__["storage"][name]
		except KeyError:
			if self.f is not None:
				if loompy.compare_loom_spec_version(self.f, "3.0.0") < 0:
					if name in self.f.attrs:
						val = self.f.attrs[name]
					else:
						raise AttributeError(f"File has no global attribute '{name}'")
				else:
					if name in self.f["attrs"]:
						val = self.f["attrs"][name]
					else:
						raise AttributeError(f"File has no global attribute '{name}'")
				materialized = loompy.materialize_attr_values(val)
				self.__dict__["storage"][name] = materialized
				return materialized

	def __setitem__(self, name: str, val: Any) -> None:
		return self.__setattr__(name, val)

	def __setattr__(self, name: str, val: Any) -> None:
		if name.startswith("!"):
			super(GlobalAttributeManager, self).__setattr__(name[1:], val)
		elif "/" in name:
			raise KeyError("Attribute name cannot contain slash (/)")
		else:
			if self.f is not None:

				if loompy.compare_loom_spec_version(self.f, "3.0.0") < 0 and "attrs" not in self.f["/"]: