r1.12: "No module named enum"

Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template
System information

Linux Ubuntu 16.04.1
no mobile device
TensorFlow installed from github
TensorFlow version: r1.12
Python version: 2.7
Installed using virtualenv? pip? conda?: apt-get
Bazel version (if compiling from source): 0.17.1
GCC/Compiler version (if compiling from source): 5.4.0
CUDA/cuDNN version: N/A
GPU model and memory: N/A

Describe the problem
File "/home/amcp011/.cache/bazel/_bazel_amcp011/2a4bcc1a1f556f9e46df7e271eeaa164/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_1.runfiles/org_tensorflow/tensorflow/python/ops/variables.py", line 20, in
import enum  # pylint: disable=g-bad-import-order
ImportError: No module named enum
Provide the exact sequence of commands / steps that you executed before running into the problem
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
Any other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.
ERROR: /home/amcp011/local/tensorflow/tensorflow/BUILD:533:1: Executing genrule //tensorflow:tf_python_api_gen_v1 failed (Exit 1)
Traceback (most recent call last):
File "/home/amcp011/.cache/bazel/_bazel_amcp011/2a4bcc1a1f556f9e46df7e271eeaa164/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_1.runfiles/org_tensorflow/tensorflow/python/tools/api/generator/create_python_api.py", line 27, in
from tensorflow.python.tools.api.generator import doc_srcs
File "/home/amcp011/.cache/bazel/_bazel_amcp011/2a4bcc1a1f556f9e46df7e271eeaa164/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_1.runfiles/org_tensorflow/tensorflow/python/init.py", line 70, in
from tensorflow.python.framework.framework_lib import *  # pylint: disable=redefined-builtin
File "/home/amcp011/.cache/bazel/_bazel_amcp011/2a4bcc1a1f556f9e46df7e271eeaa164/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_1.runfiles/org_tensorflow/tensorflow/python/framework/framework_lib.py", line 52, in
from tensorflow.python.framework.importer import import_graph_def
File "/home/amcp011/.cache/bazel/_bazel_amcp011/2a4bcc1a1f556f9e46df7e271eeaa164/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_1.runfiles/org_tensorflow/tensorflow/python/framework/importer.py", line 27, in
from tensorflow.python.framework import function
File "/home/amcp011/.cache/bazel/_bazel_amcp011/2a4bcc1a1f556f9e46df7e271eeaa164/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_1.runfiles/org_tensorflow/tensorflow/python/framework/function.py", line 36, in
from tensorflow.python.ops import resource_variable_ops
File "/home/amcp011/.cache/bazel/_bazel_amcp011/2a4bcc1a1f556f9e46df7e271eeaa164/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_1.runfiles/org_tensorflow/tensorflow/python/ops/resource_variable_ops.py", line 38, in
from tensorflow.python.ops import variables
File "/home/amcp011/.cache/bazel/_bazel_amcp011/2a4bcc1a1f556f9e46df7e271eeaa164/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_1.runfiles/org_tensorflow/tensorflow/python/ops/variables.py", line 20, in
import enum  # pylint: disable=g-bad-import-order
ImportError: No module named enum
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 128.659s, Critical Path: 101.44s
INFO: 72 processes: 72 local.
FAILED: Build did NOT complete successfully

Can you try installing enum and building again. You can do something like this:
pip install --upgrade pip enum34

I changed to python 3.6 from the ananconda3 distribution and now I get:
ERROR: /home/amcp011/local/tensorflow/tensorflow/python/eager/BUILD:10:1: undeclared inclusion(s) in rule '//tensorflow/python/eager:pywrap_tfe_lib':
this rule is missing dependency declarations for the following files included by 'tensorflow/python/eager/pywrap_tensor.cc':
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/arrayobject.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/ndarrayobject.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/ndarraytypes.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/npy_common.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/numpyconfig.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/_numpyconfig.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/npy_endian.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/npy_cpu.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/utils.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/_neighborhood_iterator_imp.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/__multiarray_api.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/npy_interrupt.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/ufuncobject.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/npy_math.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/npy_common.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/arrayobject.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/__ufunc_api.h'
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 2047.164s, Critical Path: 434.58s
INFO: 2724 processes: 2724 local.
FAILED: Build did NOT complete successfully

@jjhelmus may have some input on the 2nd issue. I think this is a configuration issue.

Is numpy installed into the conda environment?  Was site-packages directory of the environment detected by the configuration script and selected?

I got same problem :
System information:
Linux Ubuntu 16.04 LTS
no mobile device
TensorFlow installed from github
TensorFlow version: r1.12
Python version: 3.5.2
Installed using virtualenv? pip? conda?: apt-get
Bazel version (if compiling from source): 0.15.0
GCC/Compiler version (if compiling from source): 5.4.0
CUDA/cuDNN version: N/A
GPU model and memory: N/A

.tf_configure.bazelrc:
build --action_env PYTHON_BIN_PATH="/usr/bin/python3"
build --action_env PYTHON_LIB_PATH="/usr/local/lib/python3.5/dist-packages"
build --python_path="/usr/bin/python3"
build:ignite --define with_ignite_support=true
build:xla --define with_xla_support=true
build --action_env TF_NEED_OPENCL_SYCL="0"
build --action_env TF_NEED_ROCM="0"
build --action_env TF_NEED_CUDA="0"
build --action_env TF_DOWNLOAD_CLANG="0"
build:opt --copt=-march=native
build:opt --host_copt=-march=native
build:opt --define with_default_optimizations=true
build:v2 --define=tf_api_version=2

~/tensorflow$ pip3 install numpy
Requirement already satisfied: numpy in /usr/local/lib/python3.5/dist-packages (1.14.3)

Error:
ERROR: /home/rayan/tensorflow/tensorflow/python/eager/BUILD:10:1: undeclared inclusion(s) in rule '//tensorflow/python/eager:pywrap_tfe_lib':
this rule is missing dependency declarations for the following files included by 'tensorflow/python/eager/pywrap_tensor.cc':
  'bazel-out/k8-opt/genfiles/external/local_config_python/python_include/numpy/arrayobject.h'
  'bazel-out/k8-opt/genfiles/external/local_config_python/python_include/numpy/ndarrayobject.h'
  'bazel-out/k8-opt/genfiles/external/local_config_python/python_include/numpy/ndarraytypes.h'
  'bazel-out/k8-opt/genfiles/external/local_config_python/python_include/numpy/npy_common.h'
  'bazel-out/k8-opt/genfiles/external/local_config_python/python_include/numpy/numpyconfig.h'
  'bazel-out/k8-opt/genfiles/external/local_config_python/python_include/numpy/_numpyconfig.h'
  'bazel-out/k8-opt/genfiles/external/local_config_python/python_include/numpy/npy_endian.h'
  'bazel-out/k8-opt/genfiles/external/local_config_python/python_include/numpy/npy_cpu.h'
  'bazel-out/k8-opt/genfiles/external/local_config_python/python_include/numpy/utils.h'
  'bazel-out/k8-opt/genfiles/external/local_config_python/python_include/numpy/_neighborhood_iterator_imp.h'
  'bazel-out/k8-opt/genfiles/external/local_config_python/python_include/numpy/__multiarray_api.h'
  'bazel-out/k8-opt/genfiles/external/local_config_python/python_include/numpy/npy_interrupt.h'
  'bazel-out/k8-opt/genfiles/external/local_config_python/python_include/numpy/ufuncobject.h'
  'bazel-out/k8-opt/genfiles/external/local_config_python/python_include/numpy/npy_math.h'
  'bazel-out/k8-opt/genfiles/external/local_config_python/python_include/numpy/npy_common.h'
  'bazel-out/k8-opt/genfiles/external/local_config_python/python_include/numpy/arrayobject.h'
  'bazel-out/k8-opt/genfiles/external/local_config_python/python_include/numpy/__ufunc_api.h'
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.

**System information

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 18.04
Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
TensorFlow installed from (source or binary): source
TensorFlow version: 1.13.0rc2
Python version: 3.7.2
Installed using virtualenv? pip? conda?: pip
Bazel version (if compiling from source): 0.22
GCC/Compiler version (if compiling from source): 6.5.0
CUDA/cuDNN version: 10.0/7.3
GPU model and memory: RTX 2070 and 8GB

Describe the problem
ERROR: /home/max/tensorflow/tensorflow/python/eager/BUILD:10:1: undeclared inclusion(s) in rule '//tensorflow/python/eager:pywrap_tfe_lib':
this rule is missing dependency declarations for the following files included by 'tensorflow/python/eager/pywrap_tensor.cc':
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/arrayobject.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/ndarrayobject.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/ndarraytypes.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/npy_common.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/numpyconfig.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/_numpyconfig.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/npy_endian.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/npy_cpu.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/utils.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/_neighborhood_iterator_imp.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/__multiarray_api.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/npy_interrupt.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/ufuncobject.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/npy_math.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/npy_common.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/arrayobject.h'
'bazel-out/host/genfiles/external/local_config_python/python_include/numpy/__ufunc_api.h'
Target //tensorflow/tools/pip_package:build_pip_package failed to build**

pip install --upgrade pip enum34 didn't helped.
bazel build tensorflow/python/tools:optimize_for_inference
ERROR: /Users/my_user/external_projects/tensorflow/tensorflow/python/keras/api/BUILD:28:1: Executing genrule //tensorflow/python/keras/api:keras_python_api_gen_compat_v1 failed (Exit 1)
Traceback (most recent call last):
  File "/private/var/tmp/_bazel_my_user/747948fb577123a5771581be02ddf56a/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/python/keras/api/create_tensorflow.python_api_1_keras_python_api_gen_compat_v1.runfiles/org_tensorflow/tensorflow/python/tools/api/generator/create_python_api.py", line 27, in <module>
    from tensorflow.python.tools.api.generator import doc_srcs
  File "/private/var/tmp/_bazel_my_user/747948fb577123a5771581be02ddf56a/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/python/keras/api/create_tensorflow.python_api_1_keras_python_api_gen_compat_v1.runfiles/org_tensorflow/tensorflow/python/__init__.py", line 63, in <module>
    from tensorflow.python.framework.framework_lib import *  # pylint: disable=redefined-builtin
  File "/private/var/tmp/_bazel_my_user/747948fb577123a5771581be02ddf56a/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/python/keras/api/create_tensorflow.python_api_1_keras_python_api_gen_compat_v1.runfiles/org_tensorflow/tensorflow/python/framework/framework_lib.py", line 52, in <module>
    from tensorflow.python.framework.importer import import_graph_def
  File "/private/var/tmp/_bazel_my_user/747948fb577123a5771581be02ddf56a/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/python/keras/api/create_tensorflow.python_api_1_keras_python_api_gen_compat_v1.runfiles/org_tensorflow/tensorflow/python/framework/importer.py", line 28, in <module>
    from tensorflow.python.framework import function
  File "/private/var/tmp/_bazel_my_user/747948fb577123a5771581be02ddf56a/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/python/keras/api/create_tensorflow.python_api_1_keras_python_api_gen_compat_v1.runfiles/org_tensorflow/tensorflow/python/framework/function.py", line 37, in <module>
    from tensorflow.python.ops import resource_variable_ops
  File "/private/var/tmp/_bazel_my_user/747948fb577123a5771581be02ddf56a/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/python/keras/api/create_tensorflow.python_api_1_keras_python_api_gen_compat_v1.runfiles/org_tensorflow/tensorflow/python/ops/resource_variable_ops.py", line 41, in <module>
    from tensorflow.python.ops import variables
  File "/private/var/tmp/_bazel_my_user/747948fb577123a5771581be02ddf56a/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/python/keras/api/create_tensorflow.python_api_1_keras_python_api_gen_compat_v1.runfiles/org_tensorflow/tensorflow/python/ops/variables.py", line 20, in <module>
    import enum  # pylint: disable=g-bad-import-order
ImportError: No module named enum
Target //tensorflow/python/tools:optimize_for_inference failed to build
Use --verbose_failures to see the command lines of failed build steps.

I can do import enum
python -c "import enum; print(enum.__file__)"
/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/enum.py

How to check if bazel build tensorflow/python/tools:optimize_for_inference use the right python?

TF's build uses python based on which python version you use during configure.py run.

@amcphail Can you please confirm if your issue is resolved.

I reverted to the anaconda version of TF.

@amcphail please confirm if we may proceed to move this issue to resolved.

Yes.
On Wed, 19 Feb 2020, 19:41 Saduf2019<EMAIL_ADDRESS>wrote:

@amcphail https://github.com/amcphail please confirm if we may proceed
to move this issue to resolved.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tensorflow/tensorflow/issues/23200?email_source=notifications&email_token=AAKAZJ3FZRMEQ27IZIFYO7LRDTH73A5CNFSM4F63FSO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMGRTII#issuecomment-588061089,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAKAZJ54ZNCDPZFJA46KKV3RDTH73ANCNFSM4F63FSOQ
.


Notification when new message

I don't see notification when send new message to user

Hi Team,
Has there been any progress on the above-mentioned issue? It would be convenient to have a method in the front end to detect new unread messages and to add some form of event listener for new messages.
I must add, working with Crisp has been a superb experience.

We just released push notifications :)

We just released push notifications :)

Can you link the docs?


Add containedInPlace to ResponseType Place

According to API data schema there is a property containedInPlace inside the place property, besides geo and address. This describes as follows: "Description of the building/facility etc. this service point is located within". This can be a valuable hint for a customer where to find the pickup location, especially for Packstations that do not have descriptive names. First, the customer can find the place when he does not know where the Packstation is exactly located. Second, the customer might know "My Packstation is at Edeka Supermarket", but does not know which Packstation number he has to choose.
Especially for Packstations that are located within train stations or shopping centers that could be quite helpful.
Example:

Search for postal code 09119 in country DE
Find location 8007-409119139 which is "Packstation 139"
See that there is no descriptive name for this Packstation, besides "Packstation 139".
The containedInPlace property, in this case "EDEKA Markt" gives the customer a hint, where the Packstation is located and he can choose the correct Packstation without knowing the Packstation number or the street address.

Thank you @HenKun, that sounds like a useful improvement. The property was introduced in API version 1.6.0 after the library was created. I cannot give you an ETA but I do see this implemented in a future version of the package.

Thanks for considering. I modified the existing code to already include the property on my website, and it is beautiful. For your help, what I found out additionally:

containedInPlace->name might be a misleading name, it is more a broad description of where the Packstation can be found (near / in / at /by), see the image. So one does not need to assume the preposition oneself, DHL provides the preposition itself. This is really helpful. I do not know if the phrases are localized, I only tested for German language.

It is not given for every Packstation. As far as I could see it is never given for parcel shops or post offices, but not sure about that, since in theory a parcel shop or post office could be located within a larger shopping centre.
If not available, the containedInPlace property is not empty, it is not present in the dataset at all.

The containedInPlace property is returned by the SDK since version 3.0.0.


I'd love to be able to install from main copier copy gh:pyopensci/pyos-package-template .  Right now this command by default installs from main but main has the old cookie. id love to get rid of that old cookie / overwrite it with new commits if that is possible. This is the command to install from the copier branchcopier copy gh:pyopensci/pyos-package-template --vcs-ref copier .

The default behavior for copier is to use the latest tagged commit. So we should make a release of the copier template when we are ready to do so. At the moment, running the below command would pick up the latest tag which is still the cookiecutter template.
copier copy gh:pyopensci/pyos-package-template <target path>

Oh my apologies. i didn't understand when you mentioned this in slack. let me make a release against the copier branch.

I just

created a release
and reran copier - all looks good. we can close this now as it does work as expected with the new release setup.

copier copy gh:pyopensci/pyos-package-template .
🎤 Who is the copyright holder, for example, yourself or your organization? Used in the license file and project description.
   pyopensci
🎤 Who is the author of the package to be? Used in the package description.
   pyopensci
🎤 The author's email address. Used in the package description.
   pyopensco@pyo
🎤 What is the name of the project? Used as the title in the README.md and other places.
   project
🎤 What is the project slug? Used in hyperlinks.
   project
🎤 What is the Python package name? Used as the name of the package and the top-level import.
   project
🎤 Please provide a short description for the package.
    (Finish with 'Alt+Enter' or 'Esc then Enter')
> this is the description

🎤 Which development platform are you planning to use? Used to generate certain documentation and hyperlinks.
   GitHub
🎤 Your or your organization's username on GitHub. Used to generate certain documentation and hyperlinks.
   pyopensci
🎤 Which license do you want to use? Used in the license file.
   BSD-3-Clause
🎤 What is the starting year of the project? Used in copyright statements.
   2024

Copying from template version 0.3.0
 identical  .
    create  mkdocs.yml
    create  CHANGELOG.md
    create  README.md
    create  tests
    create  tests/unit
    create  tests/unit/.keep
    create  tests/integration
    create  tests/integration/.keep
    create  tests/system
    create  tests/system/test_import.py
    create  tests/system/.keep
    create  .github
    create  .github/CODE_OF_CONDUCT.md
    create  .github/SUPPORT.md
    create  .github/CONTRIBUTING.md
    create  .github/workflows
    create  .github/workflows/release.yml
    create  .github/workflows/test.yml
    create  .github/workflows/cron.yml
    create  .github/workflows/main.yml
    create  .github/PULL_REQUEST_TEMPLATE.md
    create  .github/ISSUE_TEMPLATE
    create  .github/ISSUE_TEMPLATE/config.yml
    create  .github/ISSUE_TEMPLATE/02-question.yml
    create  .github/ISSUE_TEMPLATE/03-feature-request.yml
    create  .github/ISSUE_TEMPLATE/01-bug-report.yml
    create  docs
    create  docs/index.md
    create  .editorconfig
    create  .gitignore
    create  .pre-commit-config.yaml
    create  pyproject.toml
    create  .readthedocs.yaml
    create  LICENSE
    create  src
    create  src/project
    create  src/project/__init__.py
    create  src/project/py.typed

my original long question / request
I'd love to be able to install from main copier copy gh:pyopensci/pyos-package-template .  Right now this command by default installs from main but main has the old cookie. id love to get rid of that old cookie / overwrite it with new commits if that is possible. This is the command to install from the copier branchcopier copy gh:pyopensci/pyos-package-template --vcs-ref copier .


Implementing this on 'embedded-common' library.

I have been using the https://github.com/Sensirion/embedded-common for other sensors (SGP40 and SHT, and SPS30) and the 'embedded-common' used here is not the same as the other drivers. Can you help me integrate this sensor using 'embedded-common' library?

This driver uses the embedded-common from the driver-generator/main branch: https://github.com/Sensirion/embedded-common/tree/driver-generator/main.
The https://github.com/Sensirion/embedded-i2c-sgp40 uses the same.
The differences between the two embedded-common branches aren't that big, but there was quite some restructuring and renaming that happened.

@rnestler for production use should the driver-generator/main branch should be used? So I will adjust the driver file for sps30.

@rnestler for production use should the driver-generator/main branch be used?

@PopherTheG Yes and maybe it would make sense for us to just merge it into master. We moved from writing all the drivers manually to generating them form an interface description. For that we needed to alter the API to make it easier to generate code for it.
But we didn't yet update the drivers of the older products, which were written manually.

I see. When is this merging to master expected?

I'll close this, since there is a new release of embedded-common. Pull requests to update the old drivers to a new embedded-common are welcome :slightly_smiling_face: For us the old drivers have a lower priority, since most people do prototyping with the newest sensors.


Feature Request: Support TSV and JSON file formats as input data

CSV is good for numerical data, but when you have text data that may contain , and ", escaping the values in the columns can be tricky and identification of delimiter comma is harder for CSV parsers.
Can you add support for data file formats, TSV and JSON which do not have the problems above as much?

Thank you for your suggestion.
TSV is a no brainer and will come really soon!
For JSON, the structure may be arguable (columnwise? rowwise?). Will have to put some thought into the best solution, but definitely considering it.

pandas has to_json and read_json methods in the Dataframe that support several different user specified orientation: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_json.html
So in command line we can have similar “orient” option for user to indicate which orientation the file is using.
It can also embed schema in the output json file as well. Would this work as well.

Thanks for pointing it out @dshlai . Reading this it looks like pandas has several  more I/O options that i was aware of. So yes, adding support for most of the things that pandas support is definitely feasible without too many problems. Will be coming up soon.

@w4nderlust so read_json could be used for that!

@w4nderlust Is this issue still open or anyone working on ?

@jeffin07 all work now is around TF2, so if you're interested in this feature, you could provide the PR. Thanks.

@w4nderlust Yes i would love to help in refactoring, which will also help me to understand the project more.I will checkout the branch you specified.Can you give me some guides so that it will be helpful

Sure definitely.
What I suggest you to do is to take a dataset and train a model with ludwig first. Take one of the examples in on the website, maybe text classification. I suggest you to put beakpoints everywhere in the preprocessing.py script to see what actually happens during the preprocessing, for instance how metadata is obtained and how preprocessing parameters are used and how the final data transformation id performed. You'll notice that each feature type has its own features that implement those things. I would suggest to begin with to llok just at a couple of them, for instance sequence (which is medium complex) and category (which is medium easy). Numerical and binary are the easiest, while images and audio are the most complex at the moment.
Another thing you will notice is the use of caching with HDF5 files for processed data and JSON files for metadata.
After you have an understanding of how the whole process work, you'll realize what makes it kinda tricky to extend the current design with additional data formats.
Finally, if you look a that branch that I pointed you to, you'll see a sketch of the design that I would like to follow to make preprocessing more flexibly with pluggable data formats a preprocessing strategies.
After you get to that point for sure you'll have a lot of questions. Feel free to reach out to me privately and I can answer all of them (that's just for sparing the github issue with posts).
After you have a clear picture we can define together specific tasks to perform.

This has been recently added. Closing.


Tile: add back old api

Changes
Adding back props API. Now Tile works both ways:
<Tile.Wrapper>
  <Tile.Name name='Best tile ever' />
  <Tile.ThumbnailArea>
    <Tile.ThumbnailPicture url='/local-picture' />
  </Tile.ThumbnailArea>
</Tile.Wrapper>

<Tile
  name='Second best tile ever'
  thumbnail='/another-local-file'
/>

Testing
Added unit test
Docs
Changeset

i've updated the missed references. i'll leave it on Greta to handle the rest

Would be good if there are some examples using the old Tile API. (Similar to https://github.com/iTwin/iTwinUI/pull/1502#pullrequestreview-1587639586)

@gretanausedaite I noticed you added this to the merge queue. Are we not adding examples using the old Tile API to the website?

@gretanausedaite I noticed you added this to the merge queue. Are we not adding examples using the old Tile API to the website?

Created #1538


Fix codegenerator tests

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.4 out of 5 committers have signed the CLA.:white_check_mark: michielvandergeest:white_check_mark: suresh-gangumalla:white_check_mark: jfboeve:white_check_mark: sandeep-vedam:x: mateusz-rutski-redYou have signed the CLA already but the status is still pending? Let us recheck it.


Cannot re-index or align objects with conflicting indexes

What happened?
I'm looking to rename the values of indices of an existing dataset, for both regular and multi-index. i.e. you might start with a dataset with and index [1,2,3] and you want to rename those to ["foo", "bar", "bar"].
I appear to be able to rename a couple using the method I've written, though renaming a second multi-index in the same xr.Dataset causes a ValueError I am struggling to interpret.

cannot re-index or align objects with conflicting indexes found for the following dimensions: 'x' (2 conflicting indexes)
Conflicting indexes may occur when

they relate to different sets of coordinate and/or dimension names
they don't have the same type
they may be used to reindex data along common dimensions

What did you expect to happen?
I start with the xr.Datset:
xarray.DataArray (x: 6, y: 6, z: 3)>
array(...)
Coordinates:
  * x            (x) object MultiIndex
  * x_one    (x) object 'a' 'a' 'b' 'b' 'c' 'c'
  * x_two    (x) int64 0 1 0 1 0 1
  * y            (y) object MultiIndex
  * y_one    (y) object 'a' 'a' 'b' 'b' 'c' 'c'
  * y_two    (y) int64 0 1 0 1 0 1
  * z            (z) int64 0 1 2

And remap the z, x_one, and y_one values to:
xarray.DataArray (x: 6, y: 6, z: 3)>
array(...)
Coordinates:
  * x            (x) object MultiIndex
  * x_one    (x) object 'aa' 'aa' 'bb' 'bb' 'cc' 'cc'
  * x_two    (x) int64 0 1 0 1 0 1
  * y            (y) object MultiIndex
  * y_one    (y) object 'aa' 'aa' 'bb' 'bb' 'cc' 'cc'
  * y_two    (y) int64 0 1 0 1 0 1
  * z            (z) <U4 'zero' 'one' 'two'

Minimal Complete Verifiable Example
import numpy as np
import pandas as pd
import xarray as xr

def map_coords(ds, *, name, mapping):
    """
    Takes a xarray dataset's coordinate values and updates
    them with the given the provided mapping.

    Can handle both regular indices and multi-level indices.

    ds: the datasets
    name: name of the coordinate to update
    mapping: dictionary, key of old value, value of new value.
    """
    coord = ds.coords[name]
    old_values = coord.values.tolist()
    new_values = [mapping[v] for v in old_values]
    ds.coords[name] = xr.DataArray(new_values, coords=coord.coords)
    ds.coords[name].attrs = dict(coord.attrs)

midx = pd.MultiIndex.from_product([list("abc"), [0, 1]], names=("x_one", "x_two"))
midy = pd.MultiIndex.from_product([list("abc"), [0, 1]], names=("y_one", "y_two"))

mda = xr.DataArray(np.random.rand(6, 6, 3), [("x", midx), ("y", midy), ("z", range(3))])

map_coords(mda, name="z", mapping={0: "zero", 1: "one", 2: "two"}). # success
map_coords(mda, name="x_one", mapping={"a": "aa", "b": "bb", "c": "cc"})  # success
map_coords(mda, name="y_one", mapping={"a": "aa", "b": "bb", "c": "cc"})  # ValueError

MVCE confirmation

[X] Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
[X] Complete example — the example is self-contained, including all data and the text of any traceback.
[X] Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
[X] New issue — a search of GitHub Issues suggests this is not a duplicate.

Relevant log output
Traceback (most recent call last):
  File "./main.py", line 30, in <module>
    map_coords(mda, name="y_one", mapping={"a": "aa", "b": "bb", "c": "cc"})
  File "./main.py", line 20, in map_coords
    ds.coords[name] = xr.DataArray(new_values, coords=coord.coords)
  File "./.venv/lib/python3.10/site-packages/xarray/core/coordinates.py", line 32, in __setitem__
    self.update({key: value})
  File "./.venv/lib/python3.10/site-packages/xarray/core/coordinates.py", line 162, in update
    coords, indexes = merge_coords(
  File "./.venv/lib/python3.10/site-packages/xarray/core/merge.py", line 561, in merge_coords
    aligned = deep_align(
  File "./.venv/lib/python3.10/site-packages/xarray/core/alignment.py", line 827, in deep_align
    aligned = align(
  File "./.venv/lib/python3.10/site-packages/xarray/core/alignment.py", line 764, in align
    aligner.align()
  File "./.venv/lib/python3.10/site-packages/xarray/core/alignment.py", line 550, in align
    self.assert_no_index_conflict()
  File "./.venv/lib/python3.10/site-packages/xarray/core/alignment.py", line 319, in assert_no_index_conflict
    raise ValueError(
ValueError: cannot re-index or align objects with conflicting indexes found for the following dimensions: 'x' (2 conflicting indexes)
Conflicting indexes may occur when
- they relate to different sets of coordinate and/or dimension names
- they don't have the same type
- they may be used to reindex data along common dimensions

Anything else we need to know?
I may also not be doing this remapping in the best way, this has been the easiest way I've found to do it. So maybe part of the problem is that, so open to alternative methods as well.
Thanks.

I agree that the error message is not very informative. This could be improved.
The problem in your example is located here:
def map_coords(ds, *, name, mapping):
    ...
    ds.coords[name] = xr.DataArray(new_values, coords=coord.coords)
    ...

Since v2022.6.0, multi-index level coordinates are real coordinates. What happens is that when you update "x_one" it invalidates the multi-index "x" - "x_one" - "x_two" in the DataArray:
...
map_coords(mda, name="z", mapping={0: "zero", 1: "one", 2: "two"}). # success
map_coords(mda, name="x_one", mapping={"a": "aa", "b": "bb", "c": "cc"})  # success

# the 'x', 'x_one' and 'x_two' indexes are all equal
mda.xindexes["x_one"].equals(mda.xindexes["x"]) and mda.xindexes["x_one"].equals(mda.xindexes["x_two"])
# True

# the 'x' and 'x_two' indexes are identical, but not the 'x_one' index!
mda.xindexes["x"] is mda.xindexes["x_two"]
# True
mda.xindexes["x"] is mda.xindexes["x_one"]
# False

Which explains the alignment error when you further try to update the DataArray.
I'm actually surprised that it doesn't raise any error at that point, like this:
mda = xr.DataArray(np.random.rand(6, 6, 3), [("x", midx), ("y", midy), ("z", range(3))])
mda.coords["x_two"] = ("x", range(6))
# ValueError: cannot set or update variable(s) 'x_two', which would corrupt the following
# index built from coordinates 'x', 'x_one', 'x_two':
# <xarray.core.indexes.PandasMultiIndex object at 0x1689cc190>

It seems like a bug.
Either way, you shouldn't try updating a single coordinate that is part of a multi-coordinate index, which is assumed immutable. Instead, you could use reset_index/set_index before/after updating the labels of one level coordinate. You could also replace the whole index and its coordinates at once (example below). I wouldn't rely too much on the latter option, though, as such special case for pd.MultiIndex might eventually be deprecated in Xarray.
new_midx = midx.set_levels(["aa", "bb", "cc"], level="x_one")
mda.coords["x"] = new_midx

Hi @benbovy,
Thanks for the detailed response.
Yeah, that it was only raising for the second multi indexing map, does seem like a bug in that case, I'll leave the ticket open to track that.
I didn't stumble on the set_levels function while skimming though the docs, thanks. I've updated my function to make use of that. I'm hoping things should be safe with this, and I'm correctly replacing things in the correct order.
For anyone else who's looking to do the same, or for anyone to tell me what I'm doing is not safe, or there's a simpler way, here's the updated function:
import numpy as np
import pandas as pd
import xarray as xr

def map_coords(ds, *, name, mapping):
    """
    Takes a xarray dataset's coordinate values and updates
    them with the given the provided mapping. In-place.

    Can handle both regular indices and multi-level indices.

    ds: An xr.Datset
    name: name of the coordinate to update
    mapping: dictionary, key of old value, value of new value.
    """
    # all attrs seem to get dropped on coords even if only
    # one is altered. Hold on to them and reapply after
    coord_attrs = {c: ds[c].attrs for c in ds.coords}

    if ds.indexes.is_multi(name):
        target = name
        parent = ds.indexes[target].name

        if target == parent:
            valid_targets = ds.indexes[parent].names
            raise ValueError(
                f"Can only map levels of a MultiIndex, not the MultiIndex "
                f"itself. Target one of {valid_targets}",
            )

        multi_index = ds.indexes[parent]
        level_values = dict(zip(multi_index.names, multi_index.levels))
        new_values = [mapping[v] for v in level_values[name]]
        ds.coords[parent] = multi_index.set_levels(new_values, level=target)
    else:
        old_values = ds.coords[name].values
        new_values = [mapping[v] for v in old_values]
        ds[name] = new_values

    # reapply attrs
    for coord, attrs in coord_attrs.items():
        ds[coord].attrs = attrs

midx = pd.MultiIndex.from_product([list("abc"), [0, 1]], names=("x_one", "x_two"))
midy = pd.MultiIndex.from_product([list("abc"), [0, 1]], names=("y_one", "y_two"))
mda = xr.DataArray(np.random.rand(6, 6, 3), [("x", midx), ("y", midy), ("z", range(3))])

map_coords(mda, name="z", mapping={0: "zero", 1: "one", 2: "two"})
map_coords(mda, name="x_one", mapping={"a": "aa", "b": "bb", "c": "cc"})
map_coords(mda, name="y_one", mapping={"a": "aa", "b": "bb", "c": "cc"})

print(mda)


Add score table of LGMSOC in read me

Is your feature request related to a problem? Please describe.
I want to add this in read me kindly assign it to me

.

@nisha331 I am supposed to make this Points table, along with the points given to contributors.


Slick Carousel Crashes iPhone6

My team and I are trying to implement the Slick carousel in our project. It works splendidly on every device we have tested it on except for the iPhone 6. Not only does it not work but it actually causes the phone to turn off and restart! We have tested it on earlier versions of the iPhone and also on a couple of iPads and it works just fine. The only one having an issue with it is the 6. We checked and double checked that our JS and markup is well formed and we also checked if the culprit might be one of the carousel properties. So far no luck.

Hey guys, we're experiencing the same issue on 6+. Thought it was our source but commenting out this plugin resolved our issue.

I believe this line may be the culprit : https://github.com/kenwheeler/slick/blob/master/slick/slick.js#L1091
Looks like its applying that event handler to all DOM objects.
With the line kept in the source, this is the number of listeners being added.

When commenting out this line, we see the listeners drop.

Resolved our issue with iPhone 6+

Can you guys provide a reduced test case? That way I can know the exact conditions and profile it. I have a 6 and I've never seen this.

I can't help much with this bug, but I thought I'd chime in with some experience:
Not slick specific, but the company I work for has many problems on iPhone 6+... it seems the memory management on the 6+ is total bollocks that or Safari has some major bug. Anyway, we continue to have problems all over our site due to some developer's flagrant use of delegated events from the document/body ... its a terrible practise and I'm currently trying to eradicate it... I hope that will fix the issue. It is exascerbated by zooming and rotating the screen.
It would be great if we can try to stamp it out of Slick, too :)

@simeydotme Have you guys isolated some causes of crashes on the 6+?

Its generally massively delgated events (unbinding them stabilized the
site) from the document or body... And also resize events (but less so).
Our priority now is to reduce the delegated events. Removing the ability to
pinch-zoom the page helps (user scaling), too... But just reduces the time
it takes to crash, not fix completely.
It seems to be memory leakage in iPhone6+  ... Because after one browser
crash and reload, the crashing becomes more and more frequent until the
whole phone will restart.
Apart from the general knowledge that its coming from delegated events on
iPhone6+ only, i havent got much more information :(
Hope that helps.
Si.
On 5 Mar 2015 20:36, "Ken Wheeler"<EMAIL_ADDRESS>wrote:

@simeydotme https://github.com/simeydotme Have you guys isolated some
causes of crashes on the 6+?
—
Reply to this email directly or view it on GitHub
https://github.com/kenwheeler/slick/issues/854#issuecomment-77356548.

I can say that after struggling with this for a few days that downgrading to Slick 1.5.8 fixes this issue beautifully.


[Bug]: The role updated event is captured along with group deletion event when the user delete the group

Is there an existing issue for this?

[X] I have searched the existing issues

Description
The role updated event is captured along with group deletion event when the user delete the group

Steps To Reproduce
1.Login as admin
2.go to admin setting page
3. go to groups tab
4. now delete the group
5. now go to audit log page
6.The log for role updated for all the roles associated with the group is displayed
7.now the group deleted log is captured
Public Sample App
No response
Issue video log
No response
Version
localhost

If the Role was associated to Deleted User Group, it would have been updated.
This is happening, because there is an analytics event call at the base service level.
@trishaanand can you suggest what should be done over here?

This is expected behaviour


Dangerous use of string object comparisons

I am not aiming to talk down other people's coding style or anything, but when looking at the BAM sorting code I was noticing some dangerous Python syntax in string comparisons. Basically it isn't a very good idea to compare string identity with the is keyword as here:
order_flag = "-n" if order is "queryname" else ""

The is keyword compares objects (in Python, everything is an object) by memory address (as can be checked by id()). Two separate string instances "a" and "a" will have different memory addresses, so comparing them with is would always return false if not for the reason that python uses string interning behind the scenes to globally cash strings.
However,  interning is not guaranteed to always work (since it is done heuristically and only on short strings, AFAIK), so comparing strings like this may fail randomly, in principle. As a result, strings should better be compared with ==, else we may see random errors during BAM sorting that are near impossible to track down.
Perhaps it would make sense to search globally through the bcbio code to see if this is done somewhere else, too.

Sven-Eric -- thanks for catching this. I pushed fixes for all the cases I could identify in the code. Please let us know if you find any other places this is causing issues. Much appreciated.