diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 214760d..8aa8549 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.2.5 +current_version = 0.2.6 commit = True tag = False diff --git a/pyscal_rdf/structure.py b/pyscal_rdf/structure.py index 38bdf98..d94f721 100644 --- a/pyscal_rdf/structure.py +++ b/pyscal_rdf/structure.py @@ -248,6 +248,7 @@ def delete(self, ids=None, indices=None, condition=None, selection=False): masks = self.atoms._generate_bool_list(ids=ids, indices=indices, condition=condition, selection=selection) delete_list = [masks[self.atoms["head"][x]] for x in range(self.atoms.ntotal)] delete_ids = [x for x in range(self.atoms.ntotal) if delete_list[x]] + actual_natoms = self.natoms self.atoms._delete_atoms(delete_ids) if self.graph is not None: @@ -257,7 +258,7 @@ def delete(self, ids=None, indices=None, condition=None, selection=False): self.add_vacancy(c, number=val) #now we need to re-add atoms, so at to remove self.graph.graph.remove((self.sample, CMSO.hasNumberOfAtoms, None)) - self.graph.graph.add((self.sample, CMSO.hasNumberOfAtoms, Literal(self.natoms-val, datatype=XSD.integer))) + self.graph.graph.add((self.sample, CMSO.hasNumberOfAtoms, Literal(actual_natoms-val, datatype=XSD.integer))) #revamp composition #remove existing chem composution chemical_species = self.graph.graph.value(self.sample, CMSO.hasSpecies) @@ -288,23 +289,14 @@ def delete(self, ids=None, indices=None, condition=None, selection=False): position_identifier = self.graph.graph.value(URIRef(f'{self.sample}_Position'), CMSO.hasIdentifier).toPython() species_identifier = self.graph.graph.value(URIRef(f'{self.sample}_Species'), CMSO.hasIdentifier).toPython() - #open the file for reading - with open(filepath, 'r') as fin: - data = json.load(fin) - positions = data[position_identifier]['value'] - species = data[species_identifier]['value'] - #clean up items - positions = [pos for count, pos in enumerate(positions) if count not in delete_ids] - species = [pos for count, pos in enumerate(species) if count not in delete_ids] - datadict = { position_identifier:{ - "value": positions, + "value": self.schema.atom_attribute.position(), "label": "position", }, species_identifier:{ - "value": species, + "value": self.schema.atom_attribute.species(), "label": "species", }, } diff --git a/setup.py b/setup.py index edf4ab1..a2c8380 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name='pyscal_rdf', - version='0.2.5', + version='0.2.6', author='Abril Azocar Guzman, Sarath Menon', author_email='sarath.menon@pyscal.org', description='Ontology based structural manipulation and quering',