summarylogtreecommitdiffstats
path: root/PR11.patch
diff options
context:
space:
mode:
authorMichel Zou2019-01-11 18:25:11 +0100
committerMichel Zou2019-01-11 18:25:11 +0100
commit040bef049cae91e4d25932cb799defe1f4bffe44 (patch)
tree3e770d76545ebeb258cac2e4b52444bc89c3dfc7 /PR11.patch
parentefea789456dbf872d774183ead710611244149fc (diff)
downloadaur-python-pyfmi.tar.gz
PR11
Diffstat (limited to 'PR11.patch')
-rw-r--r--PR11.patch82
1 files changed, 82 insertions, 0 deletions
diff --git a/PR11.patch b/PR11.patch
new file mode 100644
index 00000000000..3bd3bf26b08
--- /dev/null
+++ b/PR11.patch
@@ -0,0 +1,82 @@
+From 55bb786945ed5f605328bd27eb4f2cd1e6b60686 Mon Sep 17 00:00:00 2001
+From: Julien Schueller <schueller@phimeca.com>
+Date: Fri, 11 Jan 2019 09:02:05 +0100
+Subject: [PATCH 1/3] Fix encoding issue
+
+Partially addresses #10, it seems there are more of these
+---
+ src/pyfmi/fmi.pyx | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/pyfmi/fmi.pyx b/src/pyfmi/fmi.pyx
+index d30de5f..8ca80e4 100644
+--- a/src/pyfmi/fmi.pyx
++++ b/src/pyfmi/fmi.pyx
+@@ -1164,7 +1164,7 @@ cdef class FMUModelBase(ModelBase):
+
+ fmu_full_path = os.path.abspath(os.path.join(path,fmu))
+ if _unzipped_dir:
+- fmu_temp_dir = encode(_unzipped_dir)
++ fmu_temp_dir = _unzipped_dir
+ else:
+ fmu_temp_dir = encode(create_temp_dir())
+ self._fmu_temp_dir = <char*>FMIL.malloc((FMIL.strlen(fmu_temp_dir)+1)*sizeof(char))
+@@ -3758,7 +3758,7 @@ cdef class FMUModelBase2(ModelBase):
+
+ #Get the FMI version of the provided model
+ if _unzipped_dir:
+- fmu_temp_dir = encode(_unzipped_dir)
++ fmu_temp_dir = _unzipped_dir
+ else:
+ fmu_temp_dir = encode(create_temp_dir())
+ self._fmu_temp_dir = <char*>FMIL.malloc((FMIL.strlen(fmu_temp_dir)+1)*sizeof(char))
+
+From 35d0ffd76da42d78c107ba24deff25e0c46b69c7 Mon Sep 17 00:00:00 2001
+From: Julien Schueller <schueller@phimeca.com>
+Date: Fri, 11 Jan 2019 11:53:19 +0100
+Subject: [PATCH 2/3] Fix encoding for convert_str_list
+
+---
+ src/common/io.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/common/io.py b/src/common/io.py
+index 0a3c176..7490aa1 100644
+--- a/src/common/io.py
++++ b/src/common/io.py
+@@ -2141,8 +2141,8 @@ def simulation_start(self):
+ name_data = ["time"] + [var.name for var in sorted_vars]
+ desc_data = ["Time in [s]"] + [var.description for var in sorted_vars]
+
+- len_name_data, name_data = fmi_util.convert_str_list(name_data)
+- len_desc_data, desc_data = fmi_util.convert_str_list(desc_data)
++ len_name_data, name_data = fmi_util.convert_str_list(list(map(str.encode, name_data)))
++ len_desc_data, desc_data = fmi_util.convert_str_list(list(map(str.encode, desc_data)))
+
+ self._write_header("name", len_name_data, len_name_items, "char")
+ self.dump_native_data(name_data)
+
+From e72e5f5de6ffa67d0c2ef571b1213071abd0eb6b Mon Sep 17 00:00:00 2001
+From: Julien Schueller <schueller@phimeca.com>
+Date: Fri, 11 Jan 2019 13:20:21 +0100
+Subject: [PATCH 3/3] Try to fix encoding issue in ResultDymolaBinary
+
+---
+ src/common/io.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/common/io.py b/src/common/io.py
+index 7490aa1..76d24ce 100644
+--- a/src/common/io.py
++++ b/src/common/io.py
+@@ -1111,8 +1111,8 @@ def __init__(self,fname):
+ self.raw = scipy.io.loadmat(fname,chars_as_strings=False, variable_names=["name", "dataInfo", "data_1", "data_2"])
+ name = self.raw['name']
+ #self.name = ["".join(name[:,i]).rstrip() for i in range(name[0,:].size)]
+- #self.name = fmi_util.convert_array_names_list_names(name)
+- self.name = fmi_util.convert_array_names_list_names_int(name.view(np.int32))
++ self.name = fmi_util.convert_array_names_list_names(name)
++ #self.name = fmi_util.convert_array_names_list_names_int(name.view(np.int32))
+ self.dataInfo = self.raw['dataInfo'].transpose()
+
+ #self.name = [