Skip to content

Commit

Permalink
🎨 Test
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Heumos <lukas.heumos@posteo.net>
  • Loading branch information
Zethson committed Jan 26, 2025
1 parent 58a5006 commit bc62624
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lamindb/curators/_spatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,18 +235,18 @@ def add_new_from_var_index(
organism: The organism name.
**kwargs: Additional keyword arguments to pass to create new records.
"""
if self.non_validated is None:
if self._non_validated is None:
raise ValidationError("Run .validate() first.")
self._kwargs.update({"organism": organism} if organism else {})
self._table_adata_curators[table].add_new_from_var_index(
**self._kwargs, **kwargs
)
if "var_index" in self.non_validated.keys():
self.non_validated[table].pop("var_index")
self._non_validated[table].pop("var_index")

if table in self.non_validated.keys():
if len(self.non_validated[table].values()) == 0:
self.non_validated.pop(table)
self._non_validated.pop(table)

def add_new_from(
self,
Expand Down Expand Up @@ -350,15 +350,15 @@ def validate(self, organism: str | None = None) -> bool:
logger.info(f"validating categoricals of '{self._sample_metadata_key}' ...")
sample_validated &= self._sample_df_curator.validate(**self._kwargs)
if len(self._sample_df_curator.non_validated) > 0:
self.non_validated["sample"] = self._sample_df_curator.non_validated # type: ignore
self._non_validated["sample"] = self._sample_df_curator.non_validated # type: ignore
logger.print("")

mods_validated = True
for table, adata_curator in self._table_adata_curators.items():
logger.info(f"validating categoricals of table '{table}' ...")
mods_validated &= adata_curator.validate(**self._kwargs)
if len(adata_curator.non_validated) > 0:
self.non_validated[table] = adata_curator.non_validated # type: ignore
self._non_validated[table] = adata_curator.non_validated # type: ignore
logger.print("")

self._validated = sample_validated & mods_validated
Expand Down

0 comments on commit bc62624

Please sign in to comment.