Finishing the renaming.
authorFrancois Fleuret <francois@fleuret.org>
Wed, 1 Mar 2017 15:07:52 +0000 (16:07 +0100)
committerFrancois Fleuret <francois@fleuret.org>
Wed, 1 Mar 2017 15:07:52 +0000 (16:07 +0100)
Makefile
build.py
flatland.c [moved from mylib.c with 98% similarity]
flatland.h [moved from mylib.h with 100% similarity]
test.py

index b846106..3483558 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -29,12 +29,12 @@ CXXFLAGS += -I/usr/include/cairo -DCAIRO_SUPPORT
 
 LDFLAGS += -lcairo
 
-all: flatland.so TAGS
+all: flatland_generator.so TAGS
 
 TAGS: *.cc *.h
        etags *.cc *.h
 
-flatland.so: sequence_generator.o misc.o \
+flatland_generator.so: sequence_generator.o misc.o \
        universe.o \
        polygon.o \
        canvas.o canvas_cairo.o
index 4f00b97..cb77b38 100755 (executable)
--- a/build.py
+++ b/build.py
@@ -8,10 +8,10 @@ this_file = os.path.dirname(__file__)
 print('__file__', __file__)
 
 ffi = create_extension(
-    '_ext.mylib',
-    headers = [ 'mylib.h' ],
-    sources = [ 'mylib.c' ],
-    extra_objects = [ '/home/fleuret/sources/python/flatland/flatland.so' ],
+    '_ext.flatland',
+    headers = [ 'flatland.h' ],
+    sources = [ 'flatland.c' ],
+    extra_objects = [ '/home/fleuret/sources/python/flatland/flatland_generator.so' ],
     libraries = [ ],
     library_dirs = [ ],
     define_macros = [ ],
similarity index 98%
rename from mylib.c
rename to flatland.c
index 6d62c24..13da6fd 100644 (file)
--- a/mylib.c
@@ -17,7 +17,7 @@
 
  */
 
-#include "flatland.h"
+#include "sequence_generator.h"
 
 int generate_sequence(long nb_sequences, THByteTensor *output) {
   long nb_images_per_sequence = 5;
similarity index 100%
rename from mylib.h
rename to flatland.h
diff --git a/test.py b/test.py
index bf51360..314e03d 100755 (executable)
--- a/test.py
+++ b/test.py
@@ -40,10 +40,10 @@ def sequences_to_image(x):
 
 ######################################################################
 
-from _ext import mylib
+from _ext import flatland
 
 x = torch.ByteTensor()
 
-mylib.generate_sequence(10, x)
+flatland.generate_sequence(10, x)
 
 sequences_to_image(x).save('sequences.png')