Skip to content

Commit

Permalink
fixes in volume support
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkroorda committed Sep 8, 2022
1 parent c8fb775 commit 632036c
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 22 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"text-fabric-make = tf.client.make.build:main",
]
},
version='10.2.2',
version='10.2.3',
description="""Processor and browser for Text Fabric Data""",
author="Dirk Roorda",
author_email="text.annotation@icloud.com",
Expand Down
2 changes: 1 addition & 1 deletion text_fabric.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: text-fabric
Version: 10.2.2
Version: 10.2.3
Summary: Processor and browser for Text Fabric Data
Home-page: https://github.com/annotation/text-fabric
Author: Dirk Roorda
Expand Down
4 changes: 3 additions & 1 deletion tf/docs/about/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ See the app-specific tutorials via `tf.about.corpora`.

## 10

## 10.2.2
## 10.2.2-3

2022-09-08

Expand All @@ -19,6 +19,8 @@ It is detected whether it runs in interactive mode (e.g. Jupyter notebook) or no
If not, the display methods of the Jupyter notebook are suppressed,
and many outputs are done in plain text instead of HTML.

Fixes in volume support.

## 10.2.1

2022-08-23
Expand Down
2 changes: 1 addition & 1 deletion tf/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from zipfile import ZIP_DEFLATED


VERSION = '10.2.2'
VERSION = '10.2.3'
"""Program version.
This value is under control of the update process, as run by
Expand Down
2 changes: 1 addition & 1 deletion tf/volumes/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def collect(
silent=SILENT_D,
overwrite=False,
):
"""Creates a work out of a number of volumes.
"""Creates a collection out of a number of volumes.
The volumes are individual TF data sets, the work is a new TF data set.
Expand Down
38 changes: 21 additions & 17 deletions tf/volumes/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def getVolumes(volumesLocation):
if triggered:
volumes.append(vol)

return volumes
return sorted(volumes)


def extract(
Expand Down Expand Up @@ -284,8 +284,9 @@ def checkVolumeLocs():
good = True

removable = set()
for name in volumeData:
for (name, v) in volumeData.items():
loc = f"{volumesLocation}/{name}"
v["location"] = loc
if not dirEmpty(loc):
if overwrite is None:
info(
Expand Down Expand Up @@ -539,7 +540,7 @@ def remapFeatures():
metaData = {}
v["metaData"] = metaData
headStr = "-".join(str(head) for head in v["heads"])
volumeMeta = name if headStr == name else f"{name}:{headStr}"
volumeMeta = name if headStr == str(name) else f"{name}:{headStr}"

for (feat, meta) in metaDataTotal.items():
metaData[feat] = {k: m for (k, m) in meta.items()}
Expand Down Expand Up @@ -662,7 +663,7 @@ def writeTf():
nodeFeatures = v["nodeFeatures"]
edgeFeatures = v["edgeFeatures"]
loc = f"{volumesLocation}/{name}"
v["loc"] = loc
v["location"] = loc
TF = FabricCore(locations=loc, silent=DEEP)
if not TF.save(
metaData=metaData,
Expand All @@ -682,26 +683,29 @@ def process():
if not checkVolumes():
return None if show else False
if checkOnly:
if not volumeData:
result = {name: v["heads"] for (name, v) in volumeData.items()}
if volumeData:
if show:
for (name, v) in volumeData.items():
location = ux(v['location'])
print(f"{name:<20} @ {location}")
else:
return volumeData
else:
if show:
for (name, v) in result.items():
location = ux(f"{v['name']}/{name}")
print(f"{name:<20}")
print("No volumes")
else:
return result
return {}
if not getTopLevels():
return None if show else False
if not checkVolumes2():
return None if show else False
if checkOnly:
result = {name: v["heads"] for (name, v) in volumeData.items()}
if show:
for (name, v) in result.items():
location = ux(f"{v['name']}/{name}")
print(f"{name:<20}")
for (name, v) in volumeData.items():
location = ux(v['location'])
print(f"{name:<20} @ {location}")
else:
return result
return volumeData
if not distributeNodes():
return None if show else False
if not remapFeatures():
Expand All @@ -711,12 +715,12 @@ def process():
info("All done")
result = {
name: dict(location=f"{volumesLocation}/{name}", new=name in volumeData)
for name in givenVolumes
for name in sorted(givenVolumes | set(volumeData))
}
if show:
for (name, v) in result.items():
new = " (new)" if v["new"] else " " * 6
location = ux(f"{v['location']}/{name}")
location = ux(v['location'])
print(f"{name:<20}{new} @ {location}")
else:
return result
Expand Down

0 comments on commit 632036c

Please sign in to comment.