Skip to content

Commit 4b95244

Browse files
committed
Add samples placeholder folder for larger sample files
1 parent 476b92a commit 4b95244

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

samples/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
This folder contains larger sample files that are not included in the `pip` releases
2+
to keep the distribution size small. Instead of being copied locally, they are intended
3+
to be accessed via the raw user content server of Github.
4+
5+
The `compas.get()` function can be used to retrieve the path to them, just like other sample
6+
files included in the source distribution.

src/compas/__init__.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -172,27 +172,19 @@ def get(filename):
172172
----------
173173
filename : str
174174
The name of the data file.
175-
The following are available.
176-
177-
* boxes.obj
178-
* faces.obj
179-
* fink.obj
180-
* hypar.obj
181-
* lines.obj
182-
* saddle.obj
183175
184176
Returns
185177
-------
186178
str
187179
The full path to the specified file.
180+
The path can be local or remote depending on availability.
188181
189182
Notes
190183
-----
191184
The file name should be specified relative to the **COMPAS** sample data folder.
192-
This folder is only locally available if you installed **COMPAS** from source,
193-
or if you are working directly with the source.
194-
In all other cases, the function will get the corresponding files directly from
195-
the GitHub repo, at https://raw.githubusercontent.com/compas-dev/compas/main/data
185+
If the requested file is not locally available in the sample data folder,
186+
the function will get the corresponding file path from
187+
the GitHub repo, at https://raw.githubusercontent.com/compas-dev/compas/main/samples
196188
197189
Examples
198190
--------
@@ -217,7 +209,7 @@ def get(filename):
217209
if os.path.exists(localpath):
218210
return localpath
219211
else:
220-
return "https://github.com/compas-dev/compas/raw/main/data/{}".format(filename)
212+
return "https://github.com/compas-dev/compas/raw/main/samples/{}".format(filename)
221213

222214

223215
def get_bunny(localstorage=None):

0 commit comments

Comments
 (0)