text:
启停插件问题

您好！感谢您这个很酷的插件。
需求1：
当我第一次选择使用2个插件，而其他插件都停止了。
当我再一次点击启停插件时候，所有的插件又被全部选中了，这不是用户想要的。正确的是应该选中用户上次选中的插件。
需要2：
无法单独使用其中某一个插件。例如：图像预览插件
建议：
建议将启停插件改为插件管理更为合理。
Windows
最新版插件
1.8.9

此 issue 关闭，如有问题，麻烦在下面留言或者另开 issue。

非常感谢您及时修复！👍👏🎉

设置后样式变为这样了。

@zhouxinghong
每个按钮都对应一个插件，你把插件关了，那么按钮就消失了。

如果你想自定义按钮的排布和功能，可以修改配置文件 .\plugin\global\settings\custom_plugin.user.toml，添加下面内容：
我给你加了各个参数的解释，你看着修改就行。
[quickButton]
[quickButton.config]
# 添加的按钮：
#   disable:      禁用此按钮
#   coordinate:   按钮坐标。往上为x轴正方向，往左为y轴正方向，从零开始计数
#   icon:         按钮图标。填入css class。支持font-awesome-4.1.0和ionicons-2.0.1，所有的图标及其对应的css class请参考：https://www.adfwebmagazine.jp/wp-content/uploads/test_v4.1.pdf  和  https://ionic.io/ionicons/v2
#   size(可选):    图标大小。默认17px
#   color(可选):   图标颜色。默认跟随当前主题的配色方案
#   bgColor(可选): 图标背景色。默认跟随当前主题的配色方案
#   hint:         提示信息
#   callback:     回调函数。采用pluginName.MethodName的形式（功能就像hotkey.default.toml中的plugin参数和function参数的合体）
#                     MethodName请通过阅读源码查找。如果您不懂代码，但还是想添加按钮，有个碰运气技巧：在【右键菜单->常用插件->自定义插件下的插件】基本都是XXX.callback，其余插件基本都是XXX.call
#   evil(危险):    自定义回调函数。功能同hotkey.default.toml中的evil参数（它能用的，这里也能用）。这里的文本内容会被eval()。如果设置此参数，callback参数会失效
buttons = [
    { disable = false, coordinate = [0, 0], hint = "直达底部", size = "28px", icon = "fa fa-angle-down", callback = "go_top.goBottom" },
    { disable = false, coordinate = [1, 0], hint = "直达顶部", size = "28px", icon = "fa fa-angle-up", callback = "go_top.goTop" },
    { disable = false, coordinate = [2, 0], hint = "文字风格", size = "17px", icon = "fa fa-font", callback = "text_stylize.call" },
    { disable = false, coordinate = [3, 0], hint = "混排优化", size = "17px", icon = "fa fa-align-justify", callback = "md_padding.call" },
    { disable = false, coordinate = [0, 1], hint = "思维导图", size = "22px", icon = "fa fa-code-fork", callback = "markmap.onButtonClick" },
    { disable = false, coordinate = [1, 1], hint = "图片管理", size = "17px", icon = "fa fa-image", callback = "imageReviewer.callback" },
    { disable = false, coordinate = [2, 1], hint = "书签管理", size = "17px", icon = "fa fa-bookmark", callback = "scrollBookmarker.callback" },
    { disable = false, coordinate = [3, 1], hint = "高亮搜索", size = "17px", icon = "fa fa-search", callback = "search_multi.call" },
]

非常感谢您细心的指导！不过我建议这个地方可以自动根据活动插件的数量进行排版，不然的话，下次用户启用的其它的插件了，又要自己来调整这一堆的设置参数，那这个非常的痛苦，就像您上面所提到的，现在的配置超过500+ 头都大了😂，其实这个实现起来并不难。。。html 本身就能做到。。。

@zhouxinghong
每个按钮都对应一个插件，你把插件关了，那么按钮就消失了。
如果你想自定义按钮的排布和功能，可以修改配置文件 .\plugin\global\settings\custom_plugin.user.toml，添加下面内容：
我给你加了各个参数的解释，你看着修改就行。
[quickButton]
[quickButton.config]
# 添加的按钮：
#   disable:      禁用此按钮
#   coordinate:   按钮坐标。往上为x轴正方向，往左为y轴正方向，从零开始计数
#   icon:         按钮图标。填入css class。支持font-awesome-4.1.0和ionicons-2.0.1，所有的图标及其对应的css class请参考：https://www.adfwebmagazine.jp/wp-content/uploads/test_v4.1.pdf  和  https://ionic.io/ionicons/v2
#   size(可选):    图标大小。默认17px
#   color(可选):   图标颜色。默认跟随当前主题的配色方案
#   bgColor(可选): 图标背景色。默认跟随当前主题的配色方案
#   hint:         提示信息
#   callback:     回调函数。采用pluginName.MethodName的形式（功能就像hotkey.default.toml中的plugin参数和function参数的合体）
#                     MethodName请通过阅读源码查找。如果您不懂代码，但还是想添加按钮，有个碰运气技巧：在【右键菜单->常用插件->自定义插件下的插件】基本都是XXX.callback，其余插件基本都是XXX.call
#   evil(危险):    自定义回调函数。功能同hotkey.default.toml中的evil参数（它能用的，这里也能用）。这里的文本内容会被eval()。如果设置此参数，callback参数会失效
buttons = [
    { disable = false, coordinate = [0, 0], hint = "直达底部", size = "28px", icon = "fa fa-angle-down", callback = "go_top.goBottom" },
    { disable = false, coordinate = [1, 0], hint = "直达顶部", size = "28px", icon = "fa fa-angle-up", callback = "go_top.goTop" },
    { disable = false, coordinate = [2, 0], hint = "文字风格", size = "17px", icon = "fa fa-font", callback = "text_stylize.call" },
    { disable = false, coordinate = [3, 0], hint = "混排优化", size = "17px", icon = "fa fa-align-justify", callback = "md_padding.call" },
    { disable = false, coordinate = [0, 1], hint = "思维导图", size = "22px", icon = "fa fa-code-fork", callback = "markmap.onButtonClick" },
    { disable = false, coordinate = [1, 1], hint = "图片管理", size = "17px", icon = "fa fa-image", callback = "imageReviewer.callback" },
    { disable = false, coordinate = [2, 1], hint = "书签管理", size = "17px", icon = "fa fa-bookmark", callback = "scrollBookmarker.callback" },
    { disable = false, coordinate = [3, 1], hint = "高亮搜索", size = "17px", icon = "fa fa-search", callback = "search_multi.call" },
]

另外，我关闭其它插件是不得已而为之，本身电脑性能较低，小马拉大车，卡的一批。。。

插件大多都是惰性加载。如果电脑性能低，我建议将 md格式规范检测 和 中文符号自动补全 和 callouts 停用了吧，这三个插件比较吃资源。

还有我不喜欢被一堆当前不使用的插件沾满整个右键菜单。简约也是我的个人风格吧！
总之，这个地方的理想做法就是图标的位置不要固定死，应该根据插件数量动态调整为最佳方案，但是例如，去最顶端和最低端这两个插件位置可以固定。

authors: obgnail zhouxinghong


text:
Design pattern for protocol terms

We are interested in adding some protocol terms (based on existing OBI assay terms):

specimen portioning protocol
organism identification protocol
genotyping protocol
insecticide resistance assay protocol
pathogen detection protocol
blood meal host identification protocol

OBI currently only has a few protocol terms, and only one has a defining axiom. If we introduce more, it makes sense to do so following a design pattern. Should such a pattern dictate that protocol terms be given defining axioms, or should the planned process terms have defining axioms in terms of the associated protocol? (Also, if we give defining axioms to protocol terms, should they be defined in terms of an objective or a process?)

Discussed 2022-12-05. To avoid shadow hierarchies etc., we do not want protocol terms in OBI that are only defined in terms of the assays that executes them.

source: gharchive/issue

repo: obi-ontology/obi

license_type: permissive

license_source: github-api


text:
Blog post about caching

It would be nice to write a blog post about caching mechanism: folder structure, caching logic and so on...

@Yanich96 please take it

@maxonfjvipon ok

@maxonfjvipon please tell me, what existing assembly mechanisms is the EO assembly mechanism similar to? Or are there any caching systems that I would like to learn more about?

@Yanich96 you can write about compilation process here. The main feature of our assembly mechanism is cyclicity. We repeate steps: parse -> optimize -> discover -> probe -> pull until there's no files that can be processed. I don't know any other tool that would work like that

Information about ‘ccache‘:

about cchace
direct mode
preprocessor mode

Rust uses SCCACHE. SCCACHE is like CCACHE.

license: MIT


text:
How to support FontAwesome5 with react-native-web ?

Other Icons have no issue what so ever I tried Feather, Material and others but FontAwesome5 is not loading at all here's my setup code.
import FeatherIcons from '../assets/fonts/Feather.ttf';
import MaterialCommunityIcons from '../assets/fonts/MaterialCommunityIcons.ttf';
import MaterialIcons from '../assets/fonts/MaterialIcons.ttf';
import FAIcons from '../assets/fonts/FontAwesome5_Solid.ttf';

const iconFontStyles = `@font-face {
  src: url(${FeatherIcons});
  font-family: Feather;
}
@font-face {
  src: url(${FAIcons});
  font-family: FontAwesome5;
}
@font-face {
  src: url(${MaterialCommunityIcons});
  font-family: MaterialCommunityIcons;
}
@font-face {
  src: url(${MaterialIcons});
  font-family: MaterialIcons;
}
`;

const style = document.createElement('style');
style.type = 'text/css';
if (style.styleSheet) {
  style.styleSheet.cssText = iconFontStyles;
} else {
  style.appendChild(document.createTextNode(iconFontStyles));
}

// Inject stylesheet
document.head.appendChild(style);

any suggestions?

Other Icons have no issue what so ever I tried Feather, Material and others but FontAwesome5 is not loading at all here's my setup code.
import FeatherIcons from '../assets/fonts/Feather.ttf';
import MaterialCommunityIcons from '../assets/fonts/MaterialCommunityIcons.ttf';
import MaterialIcons from '../assets/fonts/MaterialIcons.ttf';
import FAIcons from '../assets/fonts/FontAwesome5_Solid.ttf';

const iconFontStyles = `@font-face {
  src: url(${FeatherIcons});
  font-family: Feather;
}
@font-face {
  src: url(${FAIcons});
  font-family: FontAwesome5;
}
@font-face {
  src: url(${MaterialCommunityIcons});
  font-family: MaterialCommunityIcons;
}
@font-face {
  src: url(${MaterialIcons});
  font-family: MaterialIcons;
}
`;

const style = document.createElement('style');
style.type = 'text/css';
if (style.styleSheet) {
  style.styleSheet.cssText = iconFontStyles;
} else {
  style.appendChild(document.createTextNode(iconFontStyles));
}

// Inject stylesheet
document.head.appendChild(style);

any suggestions?

My solution is to replace the font name with FontAwesome5_Solid. Found that when checking the dev tools

Other Icons have no issue what so ever I tried Feather, Material and others but FontAwesome5 is not loading at all here's my setup code.
import FeatherIcons from '../assets/fonts/Feather.ttf';
import MaterialCommunityIcons from '../assets/fonts/MaterialCommunityIcons.ttf';
import MaterialIcons from '../assets/fonts/MaterialIcons.ttf';
import FAIcons from '../assets/fonts/FontAwesome5_Solid.ttf';

const iconFontStyles = `@font-face {
  src: url(${FeatherIcons});
  font-family: Feather;
}
@font-face {
  src: url(${FAIcons});
  font-family: FontAwesome5;
}
@font-face {
  src: url(${MaterialCommunityIcons});
  font-family: MaterialCommunityIcons;
}
@font-face {
  src: url(${MaterialIcons});
  font-family: MaterialIcons;
}
`;

const style = document.createElement('style');
style.type = 'text/css';
if (style.styleSheet) {
  style.styleSheet.cssText = iconFontStyles;
} else {
  style.appendChild(document.createTextNode(iconFontStyles));
}

// Inject stylesheet
document.head.appendChild(style);

any suggestions?

My solution is to replace the font name with FontAwesome5_Solid. Found that when checking the dev tools

What if we need Regular fonts too?

Simply replace the font name with FontAwesome5_Regular. The final code will look like this. Always use the developer tools to discover it. 👍
import FA4Icon from "react-native-vector-icons/Fonts/FontAwesome.ttf";
import FA5IconSolid from "react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf";
import FA5IconRegular from "react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf";

const iconFontStyles = `
    @font-face {
        src: url(${FA4Icon});
        font-family: FontAwesome;
    }
    @font-face {
        src: url(${FA5IconSolid});
        font-family: 'FontAwesome5_Solid';
    }
    @font-face {
        src: url(${FA5IconRegular});
        font-family: 'FontAwesome5_Regular';
    }
`;

repo: oblador/react-native-vector-icons


text:
Exclude ttf paths changes to xcodeproj file

Each time I do a pod install the RNVectorIcons.podspec file includes all the ttf files that are includes in this package. Is there a way to exclude this? I only use react-native-vector-icons/lib/create-icon-set with a custom .ttf file, so don't need the other font files.
I don't want these changes in the [CP] Copy Pods Resources task

If I change s.resources = "Fonts/*.ttf" to s.resources = "" inside the RNVectorIcons.podspecs file I get the result I want, but I can't find away to do this programmatically before an install.

I want to do the same, since I'm using a custom font with a fontello config.

You can create a patch in order to achieve this.

Setup patch-package
Remove fonts you don’t want from /node_modules/react-native-vector-icons/Fonts
Run yarn patch-package react-native-vector-icons
Clean & build

We’ve just released a major new version with significant changes and improvements. If you’re still experiencing this issue after upgrading, please open a new issue with updated details. We're closing all the very old issues to get on top of things. Thanks for your patience!

authors: LRNZ09 RuudBurger johnf sergiulucaci


text:
brainCellRegionMarker.tsv fixes

[x] Root nodes should have no markers at all (including minimal
[ ] taxon column should pull from 'species' key here in taxonomy_details.yaml https://github.com/obophenotype/brain_data_standards_ontologies/blob/master/src/dendrograms/taxonomy_details.yaml#L7
[ ] Marker lists should be sorted consistently in marker list strings.
[ ] config typo https://github.com/obophenotype/brain_data_standards_ontologies/blob/ec_denormalised_markers/src/dendrograms/taxonomy_details.yaml#L22. Should be curie not short_form

Notes on content:

130/233 have markers
200/233 have a gross cell type # TBD - drop all those that have no gross cell type?
What explains the number of cells that have gross cell type but not markers?  I would expect this to be the case only for root nodes.  Needs investigating.  ANSWER: This seems to be due to missing entries in the marker file.

updated the related file

authors: dosumis hkir-dev


text:
pleural cavity

Please add:
abnormal pleural cavity morphology as a parent term of "pleural effusion [MP:0010334]", "hemothorax [MP:0005243]", and "pneumothorax [MP:0010822]"
DEF: any structural anomaly of the potential space between the two pleurae (visceral and parietal) of the lungs; the pleural cavity, with its associated pleurae, aids optimal functioning of the lungs during breathing; it normally contains a thin film of serous fluid (“pleural fluid”) which lubricates the opposed pleural membranes so that they can glide smoothly against one another during ventilation.
Syn: abnormal intrapleural space morphology
Syn: abnormal pleural space morphology
From J:30559, J:54641
Thanks
Anna
Reported by: anna_anagnos
Original Ticket: obo/mammalian-phenotype-requests/1650

Already completed.

authors: cindyJax obophenotype-user


text:
paint-order

Ref. https://developer.mozilla.org/en-US/docs/Web/CSS/paint-order
Related #666 #667.

Wow, I had no idea this existed. How useful!

source: gharchive/pull-request

authors: mbostock yurivish

repo: observablehq/plot

license: ISC


text:
[Enhancement]: ddl_disk_full 提供完善的帮助命令

Description
obdiag --version
OceanBase Diagnostic Tool: 2.0.0
BUILD_TIME: Apr 11 2024 11:07:02OURCE
obdiag rca run --scene=ddl_disk_full
[ERROR] rca_scene.init err: table_name or tenant_name is None. Please check the input parameters.
Trace ID: f3db1f70-226f-11ef-8420-00163e043166
obdiag rca run --scene=ddl_disk_full --help
Usage: obdiag rca run [options]
Options:
--scene=SCENE         rca scene name. The argument is required.
--store_dir=STORE_DIR
the dir to store rca result, current dir by default.
--input_parameters=INPUT_PARAMETERS
input parameters of scene
-c C                  obdiag custom config
-h, --help            Show help and exit.
-v, --verbose         Activate verbose output.
希望能提供完整的帮助命令，增强工具的易用性。

good suggestion

authors: Teingi askdb

repo: oceanbase/obdiag


text:
[Bug]: Export result set without logs

ODC version
odc423
OB version

What happened?

What did you expect to happen?
Export result set with logs
How can we reproduce it (as minimally and precisely as possible)?
Export result set, view logs
Anything else we need to know?
No response
Cloud
No response

pass

repo: oceanbase/odc


text:
In rinkeby, can't fully publish . (Asset doesn't show up in Ocean Market after first step. Can't set price etc.)

Describe the bug
In Rinkeby, asset doesn't show up in Ocean Market after publishing. Can't set price etc.
To Reproduce
Steps to reproduce the behavior:

Open browser.
Have Metamask on, with wallet connected to Rinkeby. Make sure the account has enough ETH.
Go to market.oceanprotocol.com.
Click 'connect wallet' on top right
Click on 'PUBLISH'
Fill out the whole form with test info; check the "I agree to these Terms and Conditions" box. Name of asset is "branin2".
Click 'SUBMIT' button
The page will say "Publishing Data Set : 1/5 .." then "2/5".
Metamask will pop up; click confirm. Metamask will pop up again; click confirm.
Page will say "Publishing Data Set : 3/5". Then "Successfully published. Now create a price on your dataset". It has a button "Go to dataset"
Click on the button "Go to dataset".
It goes to a page that says "Could not retrieve asset. The DDO for did:op:297E5671E9EB802b3E4494f8BeF1d84209161dea was not found in MetadataCache. If you just published a new data set, wait some seconds and refresh this page."
So I waited a minute, and refreshed. Go same error message
So I waited 15 min, and refreshed. Still the same error message
I opened a separate browser tab, went to market.oceanprotocol.com, and scrolled down to "New data sets" section. The asset ("Branin2") is not there. Nothing's there in the last hour, so it's easy to tell.

Expected behavior
To be able to publish properly, including:

Seeing the asset in Ocean Market
Setting a fixed price or doing AMM pool

Desktop (please complete the following information):

OS: Win 10
Browser: Firefox

Screenshots
If applicable, add screenshots to help explain your problem.
Ocean Market 1

Ocean Market 2

Ocean Market 3

Ocean Market 4 - see the DDO error

Ocean Market 5 - DDO error after waiting a few min

Ocean Market 6 - DDO error after waiting many min

Ocean Market - not shown in most recent assets

Metamask txs

Etherscan txs. For this address, got tx 1 and tx 2

No clue how to reproduce. Seems like an Aquarius issue, in the last weeks it went down on Rinkeby almost daily. Asset simply does not exist there: https://aquarius.rinkeby.oceanprotocol.com/api/v1/aquarius/assets/ddo/did:op:297E5671E9EB802b3E4494f8BeF1d84209161dea
Multiple sets were published on Rinkeby in last hours:

Did you try reproducing with the steps given? It happened to me two times in a row.
And if it is Aquarius issues:

there is no ux guidance on what's happening or what the user can do
the market is not able to handle the Aquarius errors robustly, eg try again or give a way to try the remaining steps later

agree, user-friendly error handling is terrible but this is also on Aquarius side resulting in market having no reliable way of detecting specific errors. This is a shortcoming of its API implementation described a bit here https://github.com/oceanprotocol/aquarius/issues/273

Thinking out loud, if we assume that it is Aquarius causing the market ux issues, then the easy way to reproduce it is to turn off Aquarius / make it act badly.
Then the Market ux can be improved to give the user better guidance (rather than an error message saying "please wait a few seconds and refresh").

As of right now we cannot differentiate if Aquarius is down or an asset is not found. All is a 500 from the market perspective cause that's what Aquarius tells us. If publishing fails somewhere in between, the UI shows a retry button but only based on transactions happening. After that we have to rely on Aquarius which we kinda can't.
As I said, I cannot reproduce, just tried another test asset and all goes successful for me on Rinkeby https://market.oceanprotocol.com/asset/did:op:94590D392B91EA6Fbc166B69de705e989e1ED33d

Here's perhaps the most robust solution, though it will take more work:
Don't use Aquarius to publish.
After all, it's only supposed to be a metadata cache. But when you're publishing you don't need a cache. You just have to get some data into ddo.sol contract.
This would likely require writing a good chunk of JS. But it would be far more robust. It also sets up nicely for v4 which will put metadata into the erc20 itself.

We use Aquarius to display an asset and there is no other way right now. As I said, nothing in the publish fails from the UI side, but when retrieving a single asset it fails. There is no way of retrieving a single asset with its metadata from somewhere else.

code example to show that Aquarius is already not used when publishing: https://github.com/oceanprotocol/ocean.js/blob/main/src/ocean/Assets.ts#L192-L199
So ocean.js tells us DDO is now on-chain, then we try to retrieve it cause we want to publish it but Aquarius does not have it. No way of detecting or reacting to that on the market.

I was able to reproduce this locally with #369 and this is the error Aquarius show in its logs:
aquarius_1         | 2021-02-09 17:03:52,105 - aquarius.events.events_monitor - ERROR - New ddo has validation errors: [{'path': 'main/files/0/contentLength', 'message': "None is not of type 'string'"}]

So in my case Aquarius wants a contentLength on the files but provider did not detect it. This is a new bug and was not present before we switched to using the provider as a file checker 5 days ago in #352

#91 fixes the root cause of this issue. We still need DDO validation before form submission to prevent users from running into similar issues for which we need to wait for resolve of https://github.com/oceanprotocol/ocean.js/issues/400

Good job working to get to the root of this!
I think I supplied this:
https://github.com/trentmc/branin/branin.arff
I did not check then (my bad). I see now that it returns a "not found" message.
It's also possible that I supplied the proper url:
https://github.com/trentmc/branin/blob/master/branin.arff

Should we set a default value from the market if the contentLength is not received from provider when checking fileinfo ? We do the same think here https://github.com/oceanprotocol/market/blob/main/src/utils/provider.ts#L31-L32 with the contentType  but that's a required parameter in the FIle interface.

yeah think so, then we're really safe and it is no overhead at all. Could you prepare a PR for it?
On principle, we should always only reflect what Aquarius' metadata validation wants in the library typings, and then in the clients. But hey, tech reality!

sure , I'll handle this.

we will have this closed by #372, which will prevent the reason for the original issue from happening again, in tandem with changes on provider.
At same time there are multiple other ways which would further help users in similar cases of "faulty" metadata. These ways are outlined in #373 and #366 and will be tackled individually there

authors: bogdanfazakas kremalicious trentmc

repo: oceanprotocol/market


text:
Get all pre-commit issues passing

Is your feature request related to a problem? Please describe.
Calina recently intro'd the optional use of the pre-commit tool into developers.md. It's cool!
If you use it when you're doing a commit, it will check the files that you've changed in your commit.
However you can also run it against the whole existing codebase via:
pre-commit run --all-files

I tried this! It changed about 6 files, and had a few failures. It would be good for pre-commit to be fully happy about the existing codebase, it will help us to move forward with less friction.
Describe the solution you'd like
Run pre-commit run --all-files. Commit the changes it's made (once unit tests pass). Then fix all the issues it reports (and ensure unit tests etc keep passing).

All the pre-commits have been run first on the entire codebase and both black and flake8 are required checks as GitHub actions. The reason for the pre-commit is so that you already have a local way of bumping into potential problems from the GitHub actions checks. This means that the failures you found are due to people not using pre-commit before (it was in the docs), merging branches without passing Github Actions, or simply conflicts/automatic merges by git.
I'll take a look later to see if everything is correctly mirrored from pre-commit checks to Github actions checks (I believe aquarius might not have the isort tool) and do a correction on all repos.

authors: calina-c trentmc


text:
[EPIC] singletons for Web3Provider and more is surprising, non-standard, and won't work for multi-chain

Is your feature request related to a problem? Please describe.
Status quo: ocean.py has these singletons, via class-level attributes:

Web3Provider. Pointer to web3 provider: ocean_lib/web3_internal/web3_provider.py:Web3Provider with attribute _web3 stored at class level. Which makes it a singleton.
ContractHandler. The class ocean_lib/web3_internal/contract_handler.py:ContractHandler has attribute _contracts which caches contracts. It also has artifacts_path.
ConfigProvider. The class  ocean_lib/config_provider.py:ConfigProvider with attribute _config which caches config params including pointer to the network. It's basically like having a bunch of global variables; though at least it's in one place.

Issues with this:

It's non-standard in web3. The main web3 python tool, web.py, allows a separate object for each web3 connection. Same with brownie.
The behavior is surprising. You don't really know that it's there unless you know.
It won't work for cross-chain, such as Eth mainnet + matic at once. And that is extremely useful behavior for Ocean as we support cross-chain, not to mention other dev users who want to do things like cross-chain arbitrage.
It gets in the way of unit tests, because right now ./tests/conftest.py::setup_all() instantiates a local singleton all the time. So you can't easily run tests for more specific behavior with these side effects happening

Note: we do use the brownie pattern of passing in wallet as the last parameter into methods that do a blockchain tx. That's good! :)
Describe the solution you'd like
Behave like web3.py and brownie. That is: each ocean = Ocean() object has its own connection to a chain. For example, a single py file with:
ocean_matic = Ocean(matic_config)
ocean_ethmainnet = Ocean(ethmainnet_config)

General Strategy:

Web3Provider: make it an object instance (not singleton)
ContractHandler: make it an instance instance (not singleton)
ConfigProvider: make it an instance, or move some of its attributes into instances (eg network url). We'll try different things and see what works best.
Note: in sw eng, there's a natural tension of providing global variables for convenience, vs tighter scoping for maintainability. A useful middle ground is to have a "context" object that gets passed around (ref Osterhout). "Make it an object" above follows this. We could also have a single object that holds each of these as sub-objects if we like. Let's see what looks best.

Note: doing this will help to prevent issues like #185 and #205 in the future

Preliminary investigation shows that this will break the interface, unless we resort to global variables (and even then it may break the interface; plus we've introduced other global variables!).
Therefore defer this to V4. (Work will start soon anyway, so ok!)

@trentmc My apologies, I was unclear.  I propose that we eliminate the ConfigProvider entirely - singleton variant is effectively global and poor design, instance variant is useless.

Web3Provider and ContractHandler still need to move away from being singletons.
Agreed.  We might actually want to eliminate them too :thinking: but I'm not sure yet.

Regarding Web3Provider
I think we should eliminate all of it except the init_web3 function which could be moved to the web3_internal.utils.
Regarding ContractHandler
I really like this file - it's well documented and well designed.  But, I think we should eliminate it.  Now that we can import the ocean addresses and ABIs from the ocean_contracts module, the ContractHandler seems entirely unnecessary.

All of the file loading stuff is trivially replaced by importing ocean_contracts. Creating a Contract instance is just a few lines:

>>> from web3 import Web3
>>> from web3.contract import ConciseContract
>>> from jsonsempai import magic
>>> from artifacts import address, Metadata
>>> web3 = Web3()
>>> contract = web3.eth.contract(address=address.development["Metadata"], abi=Metadata.abi, bytecode=Metadata.bytecode)
>>> contract
<web3.utils.datatypes.Contract object at 0x7f2a32b083a0>
>>> ccontract = web3.contract.ConciseContract(contract)
>>> ccontract
<web3.contract.ConciseContract object at 0x7f2a36a08040>

I question whether caching (a performance optimization) is worth the extra complexity. Creating a Web3 Contract instance via the python console seemed near instant to me.
For 3rd parties that use custom addresses or ABIs (stored as JSON files), we can create a solution that uses jsonsempai.

Re Web3Provider and ContractHandler -- eliminating looks entirely reasonable to me. I love when we can chop away large parts of code and still get the same functionality. So if we can get away with it let's do it.
Re ConfigProvider -- if we eliminate it, how do we handle parameter setting?

ocean.py parameters are handled by ocean_lib.config.Config, which is passed into Ocean upon initialization.
from ocean_lib.config import Config
from ocean_lib.ocean import Ocean
config = Config() # Defaults to whatever CONFIG_FILE is pointing to
ocean = Ocean(config)

If we eliminate ConfigProvider, that means that internally, Ocean will need to pass the config instance to anything that needs it. This approach can seem messy due to the increased parameter passing, but ultimately this is a better design because it avoids global state, makes it clear what the inputs of a function are, and is easier to test.

From a few comments ago:

[David] I propose that we eliminate the ConfigProvider entirely

From previous comment:

need to pass the config instance to anything that needs it

The above two statements appear contradictory. Are we going to have a config object or no?

Yes, we'll still have a config object - ocean_lib.config.Config. We can eliminate ocean_lib.config_provider.ConfigProvider

Yes, we'll still have a config object ...

Thanks. Perfect.

Moved to high prio, blocks multichain aqua

@alexcos20 Per the conclusion from yesterday's sprint planning meeting, I've added additional subtasks to this EPIC and added my estimates.

authors: DMats alexcos20 trentmc


text:
Initial size padding

Hello there,
I have been looking through the code and documentation trying to figure out if there's a method to shave off the initial buffer (which allocates to the default size of 1400) after Pickling an element.
My current solution is just to extract the native ArrayBuffer and just splice before sending it across the wire like so:
  def send(message: Message) = {
	val pickled = Pickle.intoBytes(message)
	val typedBuffer = new TypedArrayBufferOps(pickled).arrayBuffer()

	ws.send(typedBuffer.slice(0, pickled.limit))
}

While it's not too much work, since its possible to Pickle Sequence and other container alike data structures in a single command, technically there shouldn't be any mutations to be applied to the buffer. Is there some other reason for this design choice?
Thanks for reading and apologies in advanced if this isn't considered an issue =)

That's the way ByteBuffers work. They maintain an internal state of how much of the buffer is actually used. Trimming the created ByteBuffer would require additional copying.
Scala-js-dom 0.8.1 supports sending ByteBuffers over Ajax post using the following code
    implicit def byteBuffer2ajax(data: ByteBuffer): InputData = {
      if (data.hasTypedArray()) {
        // get relevant part of the underlying typed array
        data.typedArray().subarray(data.position, data.limit)
      } else {
        // fall back to copying the data
        val tempBuffer = ByteBuffer.allocateDirect(data.remaining)
        val origPosition = data.position
        tempBuffer.put(data)
        data.position(origPosition)
        tempBuffer.typedArray()
      }
    }

Suppose I need to update the documentation to clarify how to use ByteBuffers :)

authors: AlexLourenco ochrons

repo: ochrons/boopickle


text:
Fix Ansible install on CentOS

Fix Ansible install on CentOS
Removed stale repo fix as this stale repos is on the user creating the image. Since most of the resources have fresh image we should not have this.

Fixes #174
Signed-off-by: Yussuf Shaikh yussuf.shaikh@ibm.com

[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: yussufsh
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

OWNERS [yussufsh]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

/cc @Prajyot-Parab @bpradipt @cs-zhang

[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: bpradipt, yussufsh
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

OWNERS [bpradipt,yussufsh]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: bpradipt, Prajyot-Parab, yussufsh
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

OWNERS [bpradipt,yussufsh]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

authors: ltccci yussufsh


text:
webpack error NODE_MODULE_VERSION

Attempting to call npm start for my node app that uses robotjs 0.6.0 installed via npm install robotjs on node 12.16.1 under Windows 10 Pro x64.
I've got node-gyp installed, and running node-gyp rebuild in the node_modules/robotjs folder of my project runs successfully.
Current Behavior
Error: The module '\\?\C:\Users\user\Documents\project\dist\robotjs-2c1c75d03e1bba544a630b30a411799b.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 79. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1201:18)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Module.require (internal/modules/cjs/loader.js:1040:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at eval (webpack:///./node_modules/robotjs/build/Release/robotjs.node?:1:18)
    at Object../node_modules/robotjs/build/Release/robotjs.node (C:\Users\aecbo\Documents\artemis\dist\index.js:3522:1)
    at __webpack_require__ (C:\Users\user\Documents\project\dist\index.js:20:30)
    at eval (webpack:///./node_modules/robotjs/index.js?:1:15)
    at Object../node_modules/robotjs/index.js (C:\Users\user\Documents\project\dist\index.js:3533:1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1

Your Environment

RobotJS version: 0.6.0
Node.js version: 12.16.1
npm version: 6.14.2
Operating System: Windows 10 Pro x64 build 18363

same issue?

RobotJS version: 0.6.0
Node.js version: 11.12.0
npm version: 6.14.4
Operating System: MacOS Catalina 10.15.2

Same problem.

In the site there is a small explanation about building on windows. Although that did not have me a good result, after that and after using electron-rebuild (extra nom package), it started to work for me

authors: JeffreyDavidsz Sasstraliss thephucit

repo: octalmage/robotjs

license: mit

license_source: bigquery


text:
Changed MMPoint to an int to add a smoothlyMoveMouseLinear function w…

…hich takes a point, steps, and delay variables.
That way in the JS call to moveMouseSmoothLinear the user can modify the speed at which it goes through manipulating the number of steps and the delay between each step.

I will add some tests to this before it should be approved actually, but this is in response to #174 which I was also being mildly annoyed by.

I also need to give this some thought about what to do when the number of steps are greater than the difference between the two points. like going from 2,2 to 4,4 with 1000 steps. Right now it's weird.

Still need to write tests, but changing MMPoint to a double doesn't appear to break anything and fixes the issue of handling negative numbers and chunking small segments into a large number of steps.

This is very cool! I need some time to go through it, I'll try to get to it this weekend!

Thank you for your PR @murtidash and sorry for the delay, can you please resolve the conflicts and add some tests?

authors: murtidash octalmage oktapodia


text:
fix logic mistake in optimization commit

https://github.com/octolab/Cleaner/commit/0c5bc8011d9393e3df33ffb6f5fb99416a08fee0#commitcomment-17695325

reverted by cbd28778f40a04abcf804a38ff703f6c1146f40c

repo: octolab/Cleaner


text:
Add Llama-Cpp As Benchmark Option

This PR introduces llama-cpp as one of the baselines in benchmarking script. Llama-cpp has it's own tokenize logic which is done on the c++ side.
Different versions of llama-cpp would impact the final results, currently working with the cublas enabled python binding of llama-cpp with version 0.1.50. Installation script is available at https://github.com/abetlen/llama-cpp-python#installation-with-openblas--cublas--clblast with the following script:
CMAKE_ARGS="-DLLAMA_CUBLAS=on" FORCE_CMAKE=1 pip install llama-cpp-python

Thanks for checking back on this PR, this benchmark script can work now but the performance looks really bad so I'm checking details to see what can be impacting the performance. Currently at 2.35 tokens per second.

repo: octoml/mlc-llm


text:
Slimraw compressed DNG files do not open

I have here two .DNG files created by Sigma FP and then converted to lossless compressed with Slimraw
( https://www.slimraw.com )
https://www.dropbox.com/s/exehkhx884anv4u/A001_005_20220409_000001.DNG?dl=0
One is compressed with premiere cc compatible on and the other without.
https://www.dropbox.com/s/mtx0q9nhxglizns/B001_005_20220409_000001.DNG?dl=0
Both have an error when opening in RawPlayer

This is something we are aware of, unfortunately it requires some re-writing of the lossless jpeg decoder - not a quick fix :( . It is in the road map for the first quarter of 2023.

We have completed a rewrite of the lossless decompression code which now supports SlimRAW. This will be released as part of the next major revision at the end of the month

We have completed a rewrite of the lossless decompression code which now supports SlimRAW. This will be released as part of the next major revision at the end of the month

Great to hear that!

authors: larssteenhoff octopus-russell

repo: octopuscinema/raw-player


text:
🛑 GUAU (guau.umet.edu.ar) is down

In 64904ce, GUAU (guau.umet.edu.ar) (https://guau.umet.edu.ar/api/health) was down:

HTTP code: 503
Response time: 1147 ms

Resolved: GUAU (guau.umet.edu.ar) is back up in 4dadbf6.

repo: octubre-softlab/octubre-upptime


text:
Segmentationfault (core dumped) in one Chromosome

I have been getting a segmentation fault when running phase_common_static. I am using the latest version, and frankly, it's been working perfectly for me as I have used it a lot the last year. Now, I have this as a part of my script and it ran chromosomes 1-28 just fine, while I get this error at chromosome 29.
When I look into the input file, there are variants there, they look all fine (also for sample NFH_67). I have tried with different numbers of threads (1, 2, and not specifying it). I have run it 4-5 times and I get the same error every time.
So what I wonder is about the warning of no states in an sample and why the segmentation fault occurs?
I attached (half) my input file to use for testing as the full size was too big for upload here.

I tried to extract a new file of chromosome 29, and did indexing of that file, and run it through the program. With this, I get the same error, but a warning on a different individual before the error, and the error refers to a different line.
[SHAPEIT5] phase_common (jointly phase multiple common markers)
  * Author        : Olivier DELANEAU, University of Lausanne
  * Contact       : olivier.delaneau@gmail.com
  * Version       : 5.1.1 / commit = 990ed0d / release = 2023-05-08
  * Run date      : 18/04/2024 - 11:10:31

Files:
  * Input         : [/mnt/project/nanohorse/equcab3_data/prework/chr/uppar29.vcf.gz]
  * Pedigree      : [/mnt/project/nanohorse/equcab3_data/prework/updated_parents.fam]
  * Genetic Map   : [/mnt/project/nanohorse/recom_map/Averaged_ECA29_map.txt]
  * Output        : [/mnt/project/nanohorse/equcab3_data/hapshare/vcf/phased_29.bcf]
  * Output format : [bcf]
  * Output LOG    : [/mnt/project/nanohorse/equcab3_data/hapshare/vcf/phased_29.log]

Parameters:
  * Seed    : 15052011
  * Threads : 2 threads
  * MCMC    : 15 iterations [5b + 1p + 1b + 1p + 1b + 1p + 5m]
  * PBWT    : [window = 4cM / depth = auto / modulo = auto / mac = 5 / missing = 0.1]
  * HMM     : [window = 4cM / Ne = 15000 / Recombination rates given by genetic map]

Reading genotype data:
[E::bcf_hdr_parse_line] Could not parse the header line: "##chrSet=<ID=1,autosomePairCt=31,X,Y>"
  * VCF/BCF scanning done (5.38s)
      + Variants [#sites=345656 / region=29]
         - 13692 sites removed in main panel [multi-allelic]
      + Samples [#target=190 / #reference=0]
[E::bcf_hdr_parse_line] Could not parse the header line: "##chrSet=<ID=1,autosomePairCt=31,X,Y>"
  * VCF/BCF parsing done (6.14s)
      + Genotypes [0/0=67.615%, 0/1=20.752%, 1/1=10.734%, ./.=0.899%, 0|1=0.000%]
  * PED parsing [n=190] (0.00s)
  * PED mapping (0.00s)
      + #trios = 0 / #duosFat = 0 / #duosMat = 0
      + %mendel_errors = -nan% (n=0)
      + %hets_phased = -nan% (n=0)

Setting up genetic map:
  * GMAP parsing [n=26765] (0.04s)
  * cM interpolation [s=21934 / i=323722] (0.04s)
  * Region length [34775196 bp / 51.1 cM]
  * HMM parameters [Ne=15000 / Error=0.0001 / #rare=3368]

Initializing data structures:
  * Impute monomorphic [n=639920] (0.02s)
  * HAP update (0.48s)
  * H2V transpose (0.11s)
  * PBWT parameters auto setting : [modulo = 0.023 / depth = 7]
  * PBWT initialization [#eval=299344 / #select=2166 / #chunk=8] (0.04s)
  * PBWT phasing sweep (2.73s)
  * Build genotype graphs [seg=4543024] (1.31s)

Burn-in iteration [1/5]
  * PBWT selection (0.51s)
  * HMM computations [K=354.9+/-48.5 / W=7.05Mb / US=0 / UP=0] (225.77s)
  * IBD2 tracks [#inds=183 / #tracks=3907 / #merged = 46]
  * HAP update (0.38s)
  * H2V transpose (0.08s)

Burn-in iteration [2/5]
  * PBWT selection (0.75s)

^[[33mWARNING: ^[[0mNo PBWT states found [D_163 / w=0] / Using 100 random states
  * HMM computations [K=352.8+/-52.5 / W=7.35Mb / US=0 / UP=0] (223.68s)
  * IBD2 tracks [#inds=189 / #tracks=6790 / #merged = 18]
  * HAP update (0.38s)
  * H2V transpose (0.10s)

Burn-in iteration [3/5]
/var/tmp/slurmd/job14461765/slurm_script: line 779: 14315 Segmentation fault      $SCRATCH/phase_common --input $PROJDATA/prework/chr/uppar${chr}.vcf.gz --region $chr --pedigree $PROJDATA/prework/updated_parents.fam --map $GMAP/Averaged_ECA${chr}_map.txt --output $PROJDATA/hapshare/vcf/phased_${chr}.bcf --output-format bcf --thread 2 --log $PROJDATA/hapshare/vcf/phased_${chr}.log

Where the next run again, doesnt give any warning about the samples and a new line it errors out on.

[SHAPEIT5] phase_common (jointly phase multiple common markers)
  * Author        : Olivier DELANEAU, University of Lausanne
  * Contact       : olivier.delaneau@gmail.com
  * Version       : 5.1.1 / commit = 990ed0d / release = 2023-05-08
  * Run date      : 18/04/2024 - 13:06:55

Files:
  * Input         : [/mnt/project/nanohorse/equcab3_data/prework/chr/uppar29.vcf.gz]
  * Pedigree      : [/mnt/project/nanohorse/equcab3_data/prework/updated_parents.fam]
  * Genetic Map   : [/mnt/project/nanohorse/recom_map/Averaged_ECA29_map.txt]
  * Output        : [/mnt/project/nanohorse/equcab3_data/hapshare/vcf/phased_29.bcf]
  * Output format : [bcf]
  * Output LOG    : [/mnt/project/nanohorse/equcab3_data/hapshare/vcf/phased_29.log]

Parameters:
  * Seed    : 15052011
  * Threads : 2 threads
  * MCMC    : 15 iterations [5b + 1p + 1b + 1p + 1b + 1p + 5m]
  * PBWT    : [window = 4cM / depth = auto / modulo = auto / mac = 5 / missing = 0.1]
  * HMM     : [window = 4cM / Ne = 15000 / Recombination rates given by genetic map]

Reading genotype data:
[E::bcf_hdr_parse_line] Could not parse the header line: "##chrSet=<ID=1,autosomePairCt=31,X,Y>"
  * VCF/BCF scanning done (5.37s)
      + Variants [#sites=345656 / region=29]
         - 13692 sites removed in main panel [multi-allelic]
      + Samples [#target=190 / #reference=0]
[E::bcf_hdr_parse_line] Could not parse the header line: "##chrSet=<ID=1,autosomePairCt=31,X,Y>"
  * VCF/BCF parsing done (6.16s)
      + Genotypes [0/0=67.615%, 0/1=20.752%, 1/1=10.734%, ./.=0.899%, 0|1=0.000%]
  * PED parsing [n=190] (0.02s)
  * PED mapping (0.00s)

Setting up genetic map:
  * GMAP parsing [n=26765] (0.04s)
  * cM interpolation [s=21934 / i=323722] (0.03s)
  * Region length [34775196 bp / 51.1 cM]
  * HMM parameters [Ne=15000 / Error=0.0001 / #rare=3368]

Initializing data structures:
  * Impute monomorphic [n=639920] (0.02s)
  * HAP update (0.48s)
  * H2V transpose (0.09s)
  * PBWT parameters auto setting : [modulo = 0.023 / depth = 7]
  * PBWT initialization [#eval=299344 / #select=2166 / #chunk=8] (0.04s)
  * PBWT phasing sweep (2.72s)
  * Build genotype graphs [seg=4543024] (1.31s)

Burn-in iteration [1/5]
  * PBWT selection (0.52s)
  * HMM computations [K=358.0+/-44.2 / W=7.14Mb / US=0 / UP=0] (225.49s)
  * IBD2 tracks [#inds=174 / #tracks=3102 / #merged = 38]
  * HAP update (0.38s)
  * H2V transpose (0.09s)

Burn-in iteration [2/5]
  * PBWT selection (0.73s)
  * HMM computations [K=355.2+/-48.5 / W=7.14Mb / US=0 / UP=0] (222.90s)
  * IBD2 tracks [#inds=184 / #tracks=5203 / #merged = 13]
  * HAP update (0.38s)
  * H2V transpose (0.08s)

Burn-in iteration [3/5]
/var/tmp/slurmd/job14461852/slurm_script: line 779: 15983 Segmentation fault      $SCRATCH/phase_common --input $PROJDATA/prework/chr/uppar${chr}.vcf.gz --region $chr --pedigree $PROJDATA/prework/updated_parents.fam --map $GMAP/Averaged_ECA${chr}_map.txt --output $PROJDATA/hapshare/vcf/phased_${chr}.bcf --output-format bcf --thread 2 --log $PROJDATA/hapshare/vcf/phased_${chr}.log

Ended up reinstalling the software which fixed it.


text:
chore: update version of golang to 1.18

~Waiting for optimus pr to be merged first:~ https://github.com/odpf/optimus/pull/496 Merged

closing this PR as #61 this merged

authors: sbchaos smarch-int

repo: odpf/transformers


text:
🛑 urbamonde.org is down

In a279bde, urbamonde.org (https://www.urbamonde.org) was down:

HTTP code: 429
Response time: 649 ms

Resolved: urbamonde.org is back up in 576bb1d.

repo: odqo/upptime


text:
Fix documentation title

It says feedinlib in the root link and the heading of the index page. Clearly it should be oemof_pg.

Now it's oemof.db :smile:

Weird. Finds the reference, but doesn't close the issue.

authors: gnn uvchik


text:
Reorder classnames only on pre-commit

Proposed Changes

Makes sure prettier does not format classes while you are working on them.
Will run the format only on precommit.

@ohcnetwork/care-fe-code-reviewers
Merge Checklist

[ ] Add specs that demonstrate bug / test a new feature.
[ ] Update product documentation.
[ ] Ensure that UI text is kept in I18n files.
[ ] Prep screenshot or demo video for changelog entry, and attach it to issue.
[ ] Request for Peer Reviews
[ ] Completion of QA

LGTM, as the deployment and platform works


text:
[Bug] assert_near does not handle NaN correctly

#[should_panic(
    expected = "assertion failed: `0.99999976 is not within epsilon 0.00000011920929 of NaN"
)]
fn test_assert_near_nan() {
    assert_near!(std::f32::NAN, (1.0f32 - f32::EPSILON - f32::EPSILON), f32::EPSILON);
}

if wanted, I can provide a bug fix

Hmm, this needs to be handled. Do you want to work on this?

Sure, I can do it. I will also create tests with NaNs for all macros (although I think assert_near is the only one affected).

This was fixed by @molni via #7! Thanks and sorry for the insane delay!

authors: molni ohsayan


text:
Why is codeaction not supported?

This plugin is very good, but it doesn't seem to support codeaction.

Because unlike other LSP methods, we cannot redefine the handler for code actions: see here. There exists workarounds but I don't want to implement them into the plugin, it would complexify things too much. Check this plugin if you really want support for code actions.
Also I don't really see the point of fuzzy searching code actions anyway. I found it faster to select an action by typing its number in the default quickfix window than via FZF, because you don't really know which action is the one you want before reading all results.

Thanks for the quick reply!

authors: ojroques ycycyyc

repo: ojroques/nvim-lspfuzzy


text:
🛑 Ekşi Sözlük is down

In 63132aa, Ekşi Sözlük (https://eksisozluk.com) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Ekşi Sözlük is back up in 6449702.

repo: okankocyigit/upptime


text:
🛑 Website des OK Lab Flensburg is down

In a55e88f, Website des OK Lab Flensburg (https://oklabflensburg.de) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Website des OK Lab Flensburg is back up in e0bd4e9 after 11 minutes.

repo: oklabflensburg/open-health-check


text:
"Error: ENOENT: no such file or directory, open '.lintstagedrc.cjs'" when lint-staged.config.js is used

Description

I have one config file - lint-staged.config.js. It's ESM format:
export default {
  '**/*.?(c)js': (filenames) => [
    `eslint --cache --fix ${filenames.join(' ')}`,
    'ava --fail-fast',
  ],
}

ESM is enabled in package.json:
  "type": "module",
  "main": "./src/index.js",
  "exports": "./src/index.js",

Have several staged files.
In logs I see that lint-staged tries to load different configs.
Is it possible to suppress "ENOENT" error when config is not found?
Steps to reproduce
Run lint-staged manually ("scripts": { lint-staged": "lint-staged",  })
Debug Logs

expand to view
lint-staged:bin Running `lint-staged@12.3.7` +0ms
  lint-staged:bin Options parsed from command-line: {
  allowEmpty: false,
  concurrent: true,
  configPath: undefined,
  cwd: undefined,
  debug: true,
  maxArgLength: 4095.5,
  quiet: false,
  relative: false,
  shell: false,
  stash: true,
  verbose: false
} +1ms
  lint-staged:validateOptions Validating options... +0ms
  lint-staged:validateOptions Validated options! +1ms
  lint-staged Unset GIT_LITERAL_PATHSPECS (was `undefined`) +0ms
  lint-staged:runAll Running all linter scripts... +0ms
  lint-staged:runAll Using working directory `A:\develop\template-javascript` +0ms
  lint-staged:resolveGitRepo Resolving git repo from `A:\develop\template-javascript` +0ms
  lint-staged:resolveGitRepo Unset GIT_DIR (was `undefined`) +0ms
  lint-staged:resolveGitRepo Unset GIT_WORK_TREE (was `undefined`) +1ms
  lint-staged:execGit Running git command [ 'rev-parse', '--show-prefix' ] +0ms
  lint-staged:resolveGitRepo Resolved git directory to be `A:/develop/template-javascript` +76ms
  lint-staged:resolveGitRepo Resolved git config directory to be `A:/develop/template-javascript/.git` +0ms
  lint-staged:execGit Running git command [ 'log', '-1' ] +77ms
  lint-staged:execGit Running git command [ 'diff', '--staged', '--diff-filter=ACMR', '--name-only', '-z' ] +77ms
  lint-staged:runAll Loaded list of staged files in git:
  lint-staged:runAll [
  lint-staged:runAll   'A:/develop/template-javascript/.eslintrc.cjs',
  lint-staged:runAll   'A:/develop/template-javascript/README.md',
  lint-staged:runAll   'A:/develop/template-javascript/package-lock.json',
  lint-staged:runAll   'A:/develop/template-javascript/package.json'
  lint-staged:runAll ] +224ms
  lint-staged:getConfigGroups Grouping configuration files... +0ms
  lint-staged:getConfigGroups Grouping staged files by their directories... +1ms
  lint-staged:getConfigGroups Grouped staged files into 1 directories: +0ms
  lint-staged:getConfigGroups {
  lint-staged:getConfigGroups   'A:\\develop\\template-javascript': [ 'A:/develop/template-javascript/.eslintrc.cjs', 'A:/develop/template-javascript/README.md', 'A:/develop/template-javascript/package-lock.json', 'A:/develop/template-javascript/package.json' ]
  lint-staged:getConfigGroups } +1ms
  lint-staged:getConfigGroups Searching config files... +1ms
  lint-staged:loadConfig Searching for configuration from `A:\develop\template-javascript`... +0ms
  lint-staged:loadConfig Successfully loaded config from `A:\develop\template-javascript\lint-staged.config.js`:
  lint-staged:loadConfig {
  lint-staged:loadConfig   '**/*.?(c)js': [Function: **/*.?(c)js],
  lint-staged:loadConfig   '**/*.!(?(c)js)': 'prettier --write --ignore-unknown'
  lint-staged:loadConfig } +4ms
  lint-staged:getConfigGroups Found new config "A:\develop\template-javascript\lint-staged.config.js" from "A:\develop\template-javascript"! +5ms
  lint-staged:validateConfig Validating config from `A:\develop\template-javascript\lint-staged.config.js`... +0ms
  lint-staged:validateConfig Validated config from `A:\develop\template-javascript\lint-staged.config.js`: +1ms
  lint-staged:validateConfig {
  lint-staged:validateConfig   '**/*.?(c)js': [Function: **/*.?(c)js],
  lint-staged:validateConfig   '**/*.!(?(c)js)': 'prettier --write --ignore-unknown'
  lint-staged:validateConfig } +0ms
  lint-staged:loadConfig Searching for configuration from `A:\develop\template-javascript`... +3ms
  lint-staged:loadConfig Successfully loaded config from `A:\develop\template-javascript\lint-staged.config.js`:
  lint-staged:loadConfig {
  lint-staged:loadConfig   '**/*.?(c)js': [Function: **/*.?(c)js],
  lint-staged:loadConfig   '**/*.!(?(c)js)': 'prettier --write --ignore-unknown'
  lint-staged:loadConfig } +2ms
  lint-staged:getConfigGroups Found existing config "A:\develop\template-javascript\lint-staged.config.js" from "A:\develop\template-javascript"! +5ms
  lint-staged:getConfigGroups Grouped staged files into 1 groups! +0ms
  lint-staged:execGit Running git command [ 'ls-files', '-z', '--full-name' ] +83ms
  lint-staged:execGit Running git command [ 'ls-files', '-z', '--full-name', '--others', '--exclude-standard' ] +68ms
  lint-staged:loadConfig Loading configuration from `A:/develop/template-javascript/.lintstagedrc.cjs`... +142ms
  lint-staged:loadConfig Loading configuration from `A:/develop/template-javascript/package.json`... +0ms
  lint-staged:loadConfig Loading configuration from `A:/develop/template-javascript/lint-staged.config.js`... +1ms
  lint-staged:loadConfig Failed to load configuration! +1ms
[Error: ENOENT: no such file or directory, open 'A:\develop\template-javascript\.lintstagedrc.cjs'] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'A:\\develop\\template-javascript\\.lintstagedrc.cjs'
}
  lint-staged:loadConfig Successfully loaded config from `A:\develop\template-javascript\package.json`:
  lint-staged:loadConfig null +2ms
  lint-staged:loadConfig Successfully loaded config from `A:\develop\template-javascript\lint-staged.config.js`:
  lint-staged:loadConfig {
  lint-staged:loadConfig   '**/*.?(c)js': [Function: **/*.?(c)js],
  lint-staged:loadConfig   '**/*.!(?(c)js)': 'prettier --write --ignore-unknown'
  lint-staged:loadConfig } +1ms
  lint-staged:validateConfig Validating config from `A:\develop\template-javascript\lint-staged.config.js`... +151ms
  lint-staged:validateConfig Validated config from `A:\develop\template-javascript\lint-staged.config.js`: +0ms
  lint-staged:validateConfig {
  lint-staged:validateConfig   '**/*.?(c)js': [Function: **/*.?(c)js],
  lint-staged:validateConfig   '**/*.!(?(c)js)': 'prettier --write --ignore-unknown'
  lint-staged:validateConfig } +0ms
  lint-staged:runAll Found 1 configs:
  lint-staged:runAll {
  lint-staged:runAll   'A:\\develop\\template-javascript\\lint-staged.config.js': {
  lint-staged:runAll     '**/*.?(c)js': [Function: **/*.?(c)js],
  lint-staged:runAll     '**/*.!(?(c)js)': 'prettier --write --ignore-unknown'
  lint-staged:runAll   }
  lint-staged:runAll } +162ms
  lint-staged:chunkFiles Resolved an argument string length of 178 characters from 4 files +0ms
  lint-staged:chunkFiles Creating 1 chunks for maxArgLength of 4095.5 +0ms
  lint-staged:generateTasks Generating linter tasks +0ms
  lint-staged:generateTasks Generated task:
  lint-staged:generateTasks {
  lint-staged:generateTasks   pattern: '**/*.?(c)js',
  lint-staged:generateTasks   commands: [Function: **/*.?(c)js],
  lint-staged:generateTasks   fileList: [ 'A:/develop/template-javascript/.eslintrc.cjs' ]
  lint-staged:generateTasks } +3ms
  lint-staged:generateTasks Generated task:
  lint-staged:generateTasks {
  lint-staged:generateTasks   pattern: '**/*.!(?(c)js)',
  lint-staged:generateTasks   commands: 'prettier --write --ignore-unknown',
  lint-staged:generateTasks   fileList: [
  lint-staged:generateTasks     'A:/develop/template-javascript/.eslintrc.cjs',
  lint-staged:generateTasks     'A:/develop/template-javascript/README.md',
  lint-staged:generateTasks     'A:/develop/template-javascript/package-lock.json',
  lint-staged:generateTasks     'A:/develop/template-javascript/package.json'
  lint-staged:generateTasks   ]
  lint-staged:generateTasks } +2ms
  lint-staged:makeCmdTasks Creating listr tasks for commands [Function: **/*.?(c)js] +0ms
  lint-staged:makeCmdTasks Creating listr tasks for commands 'prettier --write --ignore-unknown' +0ms
  lint-staged:resolveTaskFn cmd: prettier +0ms
  lint-staged:resolveTaskFn args: [ '--write', '--ignore-unknown' ] +0ms
  lint-staged:resolveTaskFn execaOptions: {
  cwd: 'A:\\develop\\template-javascript',
  preferLocal: true,
  reject: false,
  shell: false
} +1ms
  lint-staged:resolveTaskFn cmd: eslint +2ms
  lint-staged:resolveTaskFn args: [ '--cache', '--fix', 'A:/develop/template-javascript/.eslintrc.cjs' ] +0ms
  lint-staged:resolveTaskFn execaOptions: {
  cwd: 'A:\\develop\\template-javascript',
  preferLocal: true,
  reject: false,
  shell: false
} +0ms
  lint-staged:resolveTaskFn cmd: ava +1ms
  lint-staged:resolveTaskFn args: [ '--fail-fast' ] +0ms
  lint-staged:resolveTaskFn execaOptions: {
  cwd: 'A:\\develop\\template-javascript',
  preferLocal: true,
  reject: false,
  shell: false
} +1ms
  lint-staged:chunkFiles Resolved an argument string length of 178 characters from 4 files +15ms
  lint-staged:chunkFiles Creating 1 chunks for maxArgLength of 4095.5 +0ms
[STARTED] Preparing lint-staged...
  lint-staged:GitWorkflow Backing up original state... +0ms
  lint-staged:GitWorkflow Getting partially staged files... +0ms
  lint-staged:execGit Running git command [ 'status', '-z' ] +101ms
  lint-staged:GitWorkflow Found partially staged files: [ 'package-lock.json', 'package.json' ] +87ms
  lint-staged:execGit Running git command [
  'diff',
  '--binary',
  '--unified=0',
  '--no-color',
  '--no-ext-diff',
  '--src-prefix=a/',
  '--dst-prefix=b/',
  '--patch',
  '--submodule=short',
  '--output',
  'A:\\develop\\template-javascript\\.git\\lint-staged_unstaged.patch',
  '--',
  'package-lock.json',
  'package.json'
] +87ms
  lint-staged:GitWorkflow Backing up merge state... +82ms
  lint-staged:file Reading file `A:\develop\template-javascript\.git\MERGE_HEAD` +0ms
  lint-staged:file Reading file `A:\develop\template-javascript\.git\MERGE_MODE` +0ms
  lint-staged:file Reading file `A:\develop\template-javascript\.git\MERGE_MSG` +0ms
  lint-staged:file File `A:\develop\template-javascript\.git\MERGE_HEAD` doesn't exist, ignoring... +1ms
  lint-staged:file File `A:\develop\template-javascript\.git\MERGE_MODE` doesn't exist, ignoring... +0ms
  lint-staged:file File `A:\develop\template-javascript\.git\MERGE_MSG` doesn't exist, ignoring... +0ms
  lint-staged:GitWorkflow Done backing up merge state! +3ms
  lint-staged:GitWorkflow Getting deleted files... +0ms
  lint-staged:execGit Running git command [ 'ls-files', '--deleted' ] +85ms
  lint-staged:GitWorkflow Found deleted files: [ 'A:\\develop\\template-javascript\\.lintstagedrc.cjs' ] +68ms
  lint-staged:execGit Running git command [ 'stash', 'create' ] +69ms
  lint-staged:execGit Running git command [
  'stash',
  'store',
  '--quiet',
  '--message',
  'lint-staged automatic backup',
  'a8d3d4b94f4841955bed34ea12ede3537582ff69'
] +116ms
  lint-staged:GitWorkflow Done backing up original state! +190ms
[SUCCESS] Preparing lint-staged...
[STARTED] Hiding unstaged changes to partially staged files...
  lint-staged:execGit Running git command [ 'checkout', '--force', '--', 'package-lock.json', 'package.json' ] +75ms
[SUCCESS] Hiding unstaged changes to partially staged files...
[STARTED] Running tasks for staged files...
[STARTED] lint-staged.config.js — 4 files
[STARTED] **/*.?(c)js — 1 file
[STARTED] **/*.!(?(c)js) — 4 files
[STARTED] eslint --cache --fix A:/develop/template-javascript/.eslintrc.cjs
[STARTED] prettier --write --ignore-unknown
[SUCCESS] prettier --write --ignore-unknown
[SUCCESS] **/*.!(?(c)js) — 4 files
[SUCCESS] eslint --cache --fix A:/develop/template-javascript/.eslintrc.cjs
[STARTED] ava --fail-fast
[SUCCESS] ava --fail-fast
[SUCCESS] **/*.?(c)js — 1 file
[SUCCESS] lint-staged.config.js — 4 files
[SUCCESS] Running tasks for staged files...
[STARTED] Applying modifications from tasks...
  lint-staged:GitWorkflow Adding task modifications to index... +2s
  lint-staged:execGit Running git command [
  'add',
  '--',
  'A:/develop/template-javascript/.eslintrc.cjs',
  'A:/develop/template-javascript/README.md',
  'A:/develop/template-javascript/package-lock.json',
  'A:/develop/template-javascript/package.json'
] +2s
  lint-staged:GitWorkflow Done adding task modifications to index! +78ms
  lint-staged:execGit Running git command [ 'diff', '--name-only', '--cached' ] +78ms
[SUCCESS] Applying modifications from tasks...
[STARTED] Restoring unstaged changes to partially staged files...
  lint-staged:GitWorkflow Restoring unstaged changes... +74ms
  lint-staged:execGit Running git command [
  'apply',
  '-v',
  '--whitespace=nowarn',
  '--recount',
  '--unidiff-zero',
  'A:\\develop\\template-javascript\\.git\\lint-staged_unstaged.patch'
] +74ms
[SUCCESS] Restoring unstaged changes to partially staged files...
[STARTED] Cleaning up temporary files...
  lint-staged:GitWorkflow Dropping backup stash... +93ms
  lint-staged:execGit Running git command [ 'stash', 'list' ] +93ms
  lint-staged:execGit Running git command [ 'stash', 'drop', '--quiet', 'refs/stash@{0}' ] +97ms
  lint-staged:GitWorkflow Done dropping backup stash! +196ms
[SUCCESS] Cleaning up temporary files...
  lint-staged Tasks were executed successfully! +3s

Environment

OS: Windows 10
Node.js: v16.14.2
lint-staged: v12.3.7

I'm pretty sure this will be improved in https://github.com/okonet/lint-staged/pull/1133

Is this still an issue?

Thanks for the fix!

authors: iiroj nikolay-borzov

repo: okonet/lint-staged


text:
eslint --fix failed without output (KILLED).

Description
For some reason, eslint is installed, prettier is installed, but it doesn't work, and eslint --fix is fine on the command line alone.
Here is my 'package.json'
  "lint-staged": {
    "*.{js,ts,jsx,tsx}": [
      "prettier --write",
      "eslint --fix"
    ],
    "*.vue": [
      "stylelint --fix",
      "prettier --write",
      "eslint --fix"
    ],
    "*.{less,css}": [
      "stylelint --fix",
      "prettier --write"
    ]
  },

Steps to reproduce

Debug Logs

expand to view
2023-06-14T07:50:42.065Z lint-staged:bin Options parsed from command-line: {
  allowEmpty: false,
  concurrent: true,
  configPath: undefined,
  cwd: undefined,
  debug: true,
  diff: undefined,
  diffFilter: undefined,
  maxArgLength: undefined,
  quiet: false,
  relative: false,
  shell: false,
  stash: true,
  verbose: false
}
2023-06-14T07:50:42.069Z lint-staged:validateOptions Validating options...
2023-06-14T07:50:42.069Z lint-staged:validateOptions Validated options!
2023-06-14T07:50:42.069Z lint-staged Unset GIT_LITERAL_PATHSPECS (was `undefined`)
2023-06-14T07:50:42.070Z lint-staged:runAll Running all linter scripts...
2023-06-14T07:50:42.070Z lint-staged:runAll Using working directory `/home/w/data/code/hwszwy-ui`
2023-06-14T07:50:42.070Z lint-staged:resolveGitRepo Resolving git repo from `/home/w/data/code/hwszwy-ui`
2023-06-14T07:50:42.070Z lint-staged:resolveGitRepo Unset GIT_DIR (was `undefined`)
2023-06-14T07:50:42.070Z lint-staged:resolveGitRepo Unset GIT_WORK_TREE (was `undefined`)
2023-06-14T07:50:42.071Z lint-staged:execGit Running git command [ 'rev-parse', '--show-prefix' ]
2023-06-14T07:50:42.102Z lint-staged:resolveGitRepo Resolved git directory to be `/home/w/data/code/hwszwy-ui`
2023-06-14T07:50:42.102Z lint-staged:resolveGitRepo Resolved git config directory to be `/home/w/data/code/hwszwy-ui/.git`
2023-06-14T07:50:42.102Z lint-staged:execGit Running git command [ 'log', '-1' ]
2023-06-14T07:50:42.110Z lint-staged:execGit Running git command [ 'diff', '--name-only', '-z', '--diff-filter=ACMR', '--staged' ]
2023-06-14T07:50:42.120Z lint-staged:runAll Loaded list of staged files in git:
[
  '/home/w/data/code/hwszwy-ui/src/assets/icons/console/host-asset.svg',
  '/home/w/data/code/hwszwy-ui/src/assets/icons/console/today-attack.svg',
  '/home/w/data/code/hwszwy-ui/src/assets/icons/console/today-trojan.svg',
  '/home/w/data/code/hwszwy-ui/src/assets/icons/console/total-attack.svg',
  '/home/w/data/code/hwszwy-ui/src/assets/icons/console/total-trojan.svg',
  '/home/w/data/code/hwszwy-ui/src/assets/icons/console/trust-client.svg',
  '/home/w/data/code/hwszwy-ui/src/assets/icons/console/welcome.svg',
  '/home/w/data/code/hwszwy-ui/src/assets/style/global.less',
  '/home/w/data/code/hwszwy-ui/src/locale/en-US.ts',
  '/home/w/data/code/hwszwy-ui/src/locale/zh-CN.ts',
  '/home/w/data/code/hwszwy-ui/src/views/console/components/components/host-asset.vue',
  '/home/w/data/code/hwszwy-ui/src/views/console/components/components/today-attack.vue',
  '/home/w/data/code/hwszwy-ui/src/views/console/components/components/today-trojan.vue',
  '/home/w/data/code/hwszwy-ui/src/views/console/components/components/total-attack.vue',
  '/home/w/data/code/hwszwy-ui/src/views/console/components/components/total-trojan.vue',
  '/home/w/data/code/hwszwy-ui/src/views/console/components/components/trust-client.vue',
  '/home/w/data/code/hwszwy-ui/src/views/console/components/data-panel.vue',
  '/home/w/data/code/hwszwy-ui/src/views/console/index.vue',
  '/home/w/data/code/hwszwy-ui/src/views/console/locale/en-US.ts',
  '/home/w/data/code/hwszwy-ui/src/views/console/locale/zh-CN.ts'
]
2023-06-14T07:50:42.120Z lint-staged:searchConfigs Searching for configuration files...
2023-06-14T07:50:42.120Z lint-staged:execGit Running git command [ 'ls-files', '-z', '--full-name' ]
2023-06-14T07:50:42.125Z lint-staged:execGit Running git command [ 'ls-files', '-z', '--full-name', '--others', '--exclude-standard' ]
2023-06-14T07:50:42.134Z lint-staged:searchConfigs Found possible config files: [ '/home/w/data/code/hwszwy-ui/package.json' ]
2023-06-14T07:50:42.135Z lint-staged:loadConfig Loading configuration from `/home/w/data/code/hwszwy-ui/package.json`...
2023-06-14T07:50:42.136Z lint-staged:loadConfig Successfully loaded config from `/home/w/data/code/hwszwy-ui/package.json`:
{
  '*.{js,ts,jsx,tsx}': [ 'prettier --write', 'eslint --fix' ],
  '*.vue': [ 'stylelint --fix', 'prettier --write', 'eslint --fix' ],
  '*.{less,css}': [ 'stylelint --fix', 'prettier --write' ]
}
2023-06-14T07:50:42.137Z lint-staged:validateConfig Validating config from `/home/w/data/code/hwszwy-ui/package.json`...
2023-06-14T07:50:42.137Z lint-staged:validateConfig Validated config from `/home/w/data/code/hwszwy-ui/package.json`:
2023-06-14T07:50:42.139Z lint-staged:validateConfig {
  '*.{js,ts,jsx,tsx}': [ 'prettier --write', 'eslint --fix' ],
  '*.vue': [ 'stylelint --fix', 'prettier --write', 'eslint --fix' ],
  '*.{less,css}': [ 'stylelint --fix', 'prettier --write' ]
}
2023-06-14T07:50:42.139Z lint-staged:searchConfigs Found 1 config files
2023-06-14T07:50:42.140Z lint-staged:groupFilesByConfig Grouping 20 files by 1 configurations
2023-06-14T07:50:42.141Z lint-staged:chunkFiles Resolved an argument string length of 1395 characters from 20 files
2023-06-14T07:50:42.141Z lint-staged:chunkFiles Creating 1 chunks for maxArgLength of 65536
2023-06-14T07:50:42.141Z lint-staged:generateTasks Generating linter tasks
2023-06-14T07:50:42.146Z lint-staged:generateTasks Generated task:
{
  pattern: '*.{js,ts,jsx,tsx}',
  commands: [ 'prettier --write', 'eslint --fix' ],
  fileList: [
    '/home/w/data/code/hwszwy-ui/src/locale/en-US.ts',
    '/home/w/data/code/hwszwy-ui/src/locale/zh-CN.ts',
    '/home/w/data/code/hwszwy-ui/src/views/console/locale/en-US.ts',
    '/home/w/data/code/hwszwy-ui/src/views/console/locale/zh-CN.ts'
  ]
}
2023-06-14T07:50:42.147Z lint-staged:generateTasks Generated task:
{
  pattern: '*.vue',
  commands: [ 'stylelint --fix', 'prettier --write', 'eslint --fix' ],
  fileList: [
    '/home/w/data/code/hwszwy-ui/src/views/console/components/components/host-asset.vue',
    '/home/w/data/code/hwszwy-ui/src/views/console/components/components/today-attack.vue',
    '/home/w/data/code/hwszwy-ui/src/views/console/components/components/today-trojan.vue',
    '/home/w/data/code/hwszwy-ui/src/views/console/components/components/total-attack.vue',
    '/home/w/data/code/hwszwy-ui/src/views/console/components/components/total-trojan.vue',
    '/home/w/data/code/hwszwy-ui/src/views/console/components/components/trust-client.vue',
    '/home/w/data/code/hwszwy-ui/src/views/console/components/data-panel.vue',
    '/home/w/data/code/hwszwy-ui/src/views/console/index.vue'
  ]
}
2023-06-14T07:50:42.148Z lint-staged:generateTasks Generated task:
{
  pattern: '*.{less,css}',
  commands: [ 'stylelint --fix', 'prettier --write' ],
  fileList: [ '/home/w/data/code/hwszwy-ui/src/assets/style/global.less' ]
}
2023-06-14T07:50:42.148Z lint-staged:makeCmdTasks Creating listr tasks for commands [ 'prettier --write', 'eslint --fix' ]
2023-06-14T07:50:42.151Z lint-staged:resolveTaskFn cmd: prettier
2023-06-14T07:50:42.151Z lint-staged:resolveTaskFn args: [ '--write' ]
2023-06-14T07:50:42.151Z lint-staged:resolveTaskFn execaOptions: {
  cwd: '/home/w/data/code/hwszwy-ui',
  preferLocal: true,
  reject: false,
  shell: false
}
2023-06-14T07:50:42.152Z lint-staged:resolveTaskFn cmd: eslint
2023-06-14T07:50:42.152Z lint-staged:resolveTaskFn args: [ '--fix' ]
2023-06-14T07:50:42.152Z lint-staged:resolveTaskFn execaOptions: {
  cwd: '/home/w/data/code/hwszwy-ui',
  preferLocal: true,
  reject: false,
  shell: false
}
2023-06-14T07:50:42.152Z lint-staged:makeCmdTasks Creating listr tasks for commands [ 'stylelint --fix', 'prettier --write', 'eslint --fix' ]
2023-06-14T07:50:42.152Z lint-staged:resolveTaskFn cmd: stylelint
2023-06-14T07:50:42.152Z lint-staged:resolveTaskFn args: [ '--fix' ]
2023-06-14T07:50:42.152Z lint-staged:resolveTaskFn execaOptions: {
  cwd: '/home/w/data/code/hwszwy-ui',
  preferLocal: true,
  reject: false,
  shell: false
}
2023-06-14T07:50:42.153Z lint-staged:resolveTaskFn cmd: prettier
2023-06-14T07:50:42.153Z lint-staged:resolveTaskFn args: [ '--write' ]
2023-06-14T07:50:42.153Z lint-staged:resolveTaskFn execaOptions: {
  cwd: '/home/w/data/code/hwszwy-ui',
  preferLocal: true,
  reject: false,
  shell: false
}
2023-06-14T07:50:42.153Z lint-staged:resolveTaskFn cmd: eslint
2023-06-14T07:50:42.153Z lint-staged:resolveTaskFn args: [ '--fix' ]
2023-06-14T07:50:42.153Z lint-staged:resolveTaskFn execaOptions: {
  cwd: '/home/w/data/code/hwszwy-ui',
  preferLocal: true,
  reject: false,
  shell: false
}
2023-06-14T07:50:42.153Z lint-staged:makeCmdTasks Creating listr tasks for commands [ 'stylelint --fix', 'prettier --write' ]
2023-06-14T07:50:42.154Z lint-staged:resolveTaskFn cmd: stylelint
2023-06-14T07:50:42.154Z lint-staged:resolveTaskFn args: [ '--fix' ]
2023-06-14T07:50:42.154Z lint-staged:resolveTaskFn execaOptions: {
  cwd: '/home/w/data/code/hwszwy-ui',
  preferLocal: true,
  reject: false,
  shell: false
}
2023-06-14T07:50:42.154Z lint-staged:resolveTaskFn cmd: prettier
2023-06-14T07:50:42.154Z lint-staged:resolveTaskFn args: [ '--write' ]
2023-06-14T07:50:42.154Z lint-staged:resolveTaskFn execaOptions: {
  cwd: '/home/w/data/code/hwszwy-ui',
  preferLocal: true,
  reject: false,
  shell: false
}
2023-06-14T07:50:42.155Z lint-staged:chunkFiles Resolved an argument string length of 912 characters from 13 files
2023-06-14T07:50:42.155Z lint-staged:chunkFiles Creating 1 chunks for maxArgLength of 65536
[STARTED] Preparing lint-staged...
2023-06-14T07:50:42.159Z lint-staged:GitWorkflow Backing up original state...
2023-06-14T07:50:42.159Z lint-staged:GitWorkflow Getting partially staged files...
2023-06-14T07:50:42.159Z lint-staged:execGit Running git command [ 'status', '-z' ]
2023-06-14T07:50:42.169Z lint-staged:GitWorkflow Found partially staged files: []
2023-06-14T07:50:42.169Z lint-staged:GitWorkflow Backing up merge state...
2023-06-14T07:50:42.169Z lint-staged:file Reading file `/home/w/data/code/hwszwy-ui/.git/MERGE_HEAD`
2023-06-14T07:50:42.169Z lint-staged:file Reading file `/home/w/data/code/hwszwy-ui/.git/MERGE_MODE`
2023-06-14T07:50:42.169Z lint-staged:file Reading file `/home/w/data/code/hwszwy-ui/.git/MERGE_MSG`
2023-06-14T07:50:42.169Z lint-staged:file File `/home/w/data/code/hwszwy-ui/.git/MERGE_HEAD` doesn't exist, ignoring...
2023-06-14T07:50:42.169Z lint-staged:file File `/home/w/data/code/hwszwy-ui/.git/MERGE_MODE` doesn't exist, ignoring...
2023-06-14T07:50:42.169Z lint-staged:file File `/home/w/data/code/hwszwy-ui/.git/MERGE_MSG` doesn't exist, ignoring...
2023-06-14T07:50:42.169Z lint-staged:GitWorkflow Done backing up merge state!
2023-06-14T07:50:42.170Z lint-staged:GitWorkflow Getting deleted files...
2023-06-14T07:50:42.170Z lint-staged:execGit Running git command [ 'ls-files', '--deleted' ]
2023-06-14T07:50:42.175Z lint-staged:GitWorkflow Found deleted files: []
2023-06-14T07:50:42.175Z lint-staged:execGit Running git command [ 'stash', 'create' ]
2023-06-14T07:50:42.188Z lint-staged:execGit Running git command [
  'stash',
  'store',
  '--quiet',
  '--message',
  'lint-staged automatic backup',
  '98d932d2d258179ebab98d57559047f7d6ad612b'
]
2023-06-14T07:50:42.194Z lint-staged:GitWorkflow Done backing up original state!
[SUCCESS] Preparing lint-staged...
[STARTED] Running tasks for staged files...
[STARTED] package.json — 20 files
[STARTED] *.{js,ts,jsx,tsx} — 4 files
[STARTED] *.vue — 8 files
[STARTED] *.{less,css} — 1 file
[STARTED] prettier --write
[STARTED] stylelint --fix
[STARTED] stylelint --fix
[SUCCESS] prettier --write
[STARTED] eslint --fix
[SUCCESS] stylelint --fix
[STARTED] prettier --write
[FAILED] stylelint --fix [FAILED]
[FAILED] stylelint --fix [FAILED]
[FAILED] stylelint --fix [FAILED]
[STARTED] Applying modifications from tasks...
[SKIPPED] Skipped because of errors from tasks.
[STARTED] Reverting to original state because of errors...
2023-06-14T07:50:44.104Z lint-staged:GitWorkflow Restoring original state...
2023-06-14T07:50:44.104Z lint-staged:execGit Running git command [ 'reset', '--hard', 'HEAD' ]
2023-06-14T07:50:44.118Z lint-staged:resolveTaskFn Failed to kill process with pid "1434041": Error: No matching pid found at /home/w/data/code/hwszwy-ui/node_modules/.pnpm/pidtree@0.6.0/node_modules/pidtree/lib/pidtree.js:61:16 at /home/w/data/code/hwszwy-ui/node_modules/.pnpm/pidtree@0.6.0/node_modules/pidtree/lib/ps.js:40:7 at ChildProcess.<anonymous> (/home/w/data/code/hwszwy-ui/node_modules/.pnpm/pidtree@0.6.0/node_modules/pidtree/lib/bin.js:57:5) at ChildProcess.emit (node:events:527:28) at maybeClose (node:internal/child_process:1092:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
[FAILED] eslint --fix [KILLED]
[FAILED] eslint --fix [KILLED]
2023-06-14T07:50:44.124Z lint-staged:execGit Running git command [ 'stash', 'list' ]
2023-06-14T07:50:44.134Z lint-staged:execGit Running git command [ 'stash', 'apply', '--quiet', '--index', '0' ]
2023-06-14T07:50:44.162Z lint-staged:GitWorkflow Restoring merge state...
2023-06-14T07:50:44.162Z lint-staged:GitWorkflow Done restoring merge state!
2023-06-14T07:50:44.162Z lint-staged:file Removing file `/home/w/data/code/hwszwy-ui/.git/lint-staged_unstaged.patch`
2023-06-14T07:50:44.162Z lint-staged:file File `/home/w/data/code/hwszwy-ui/.git/lint-staged_unstaged.patch` doesn't exist, ignoring...
2023-06-14T07:50:44.162Z lint-staged:GitWorkflow Done restoring original state!
[SUCCESS] Reverting to original state because of errors...
[STARTED] Cleaning up temporary files...
2023-06-14T07:50:44.163Z lint-staged:GitWorkflow Dropping backup stash...
2023-06-14T07:50:44.163Z lint-staged:execGit Running git command [ 'stash', 'list' ]
2023-06-14T07:50:44.171Z lint-staged:execGit Running git command [ 'stash', 'drop', '--quiet', '0' ]
2023-06-14T07:50:44.177Z lint-staged:GitWorkflow Done dropping backup stash!
[SUCCESS] Cleaning up temporary files...

✖ stylelint --fix:
TypeError: node.rangeBy is not a function
    at report (/home/w/data/code/hwszwy-ui/node_modules/.pnpm/stylelint@15.7.0/node_modules/stylelint/lib/utils/report.js:35:34)
    at /home/w/data/code/hwszwy-ui/node_modules/.pnpm/stylelint@15.7.0/node_modules/stylelint/lib/rules/no-empty-source/index.js:32:3
    at /home/w/data/code/hwszwy-ui/node_modules/.pnpm/stylelint@15.7.0/node_modules/stylelint/lib/lintPostcssResult.js:120:8
    at Array.map (<anonymous>)
    at lintPostcssResult (/home/w/data/code/hwszwy-ui/node_modules/.pnpm/stylelint@15.7.0/node_modules/stylelint/lib/lintPostcssResult.js:110:18)
    at lintSource (/home/w/data/code/hwszwy-ui/node_modules/.pnpm/stylelint@15.7.0/node_modules/stylelint/lib/lintSource.js:110:8)
    at async /home/w/data/code/hwszwy-ui/node_modules/.pnpm/stylelint@15.7.0/node_modules/stylelint/lib/standalone.js:210:27
    at async Promise.all (index 6)
    at async standalone (/home/w/data/code/hwszwy-ui/node_modules/.pnpm/stylelint@15.7.0/node_modules/stylelint/lib/standalone.js:253:22)

✖ eslint --fix failed without output (KILLED).

Environment

OS: ArchLinux
Node.js:v16.15.1
lint-staged:13.2.2

I think it's related to the style lint. Can you try running eslint first and only then the style lint?

也许更新 stylelint 会有所帮助，这可能是一个相关的问题：stylelint/stylelint#5766

Here is my stylelint version
package.json
    "stylelint": "^14.13.0",
    "stylelint-config-prettier": "^9.0.3",
    "stylelint-config-rational-order": "^0.1.2",
    "stylelint-config-recommended-vue": "^1.4.0",
    "stylelint-config-standard": "^29.0.0",
    "stylelint-order": "^5.0.0",

I think it's related to the style lint. Can you try running eslint first and only then the style lint?

Maybe updating stylelint would help, this might be a related issue: stylelint/stylelint#5766

I updated stylelint to the latest version. Thank you

authors: Wjinlei okonet


text:
Get a plot as a string

I'm working on a tool that I would love to be able to integrate uniplot into, but I'm running into a problem: I need to capture the output as a string so that I can display it elsewhere. Right now, uniplot.plot prints directly to stdout: https://github.com/olavolav/uniplot/blob/master/uniplot/uniplot.py#L74
I'm not sure how to square this with the interactive features implemented in that function. Perhaps a helper function could be extracted that returns the plot as a string? Then I could call that function from my tool to get the string that uniplot.plot would have displayed.
Happy to do the work on this if you can provide some guidance on how you'd like it implemented!

Thanks @JoshKarpel!
I'll have a look over the weekend, but I think it shouldn't be too hard, might actually end up with more readable code when splitting the plot generation and text output.
I also thought about limiting the bounding box of the plot, this should also be possible by computing the vertical axis labels first, and then shrinking the plot window if needed. But I'll leave this for a later date.

Hi @JoshKarpel I just added such a function in version 0.4.4 🚢
Haven't gotten around to do the "hard cap on line length" part yet, but hope this helps already.
If you can share I'd be curious to see what you end up with on your side!

Hi @JoshKarpel I just added such a function in version 0.4.4 🚢
Haven't gotten around to do the "hard cap on line length" part yet, but hope this helps already.
If you can share I'd be curious to see what you end up with on your side!

It's working really well so far! https://github.com/JoshKarpel/spiel/pull/33/files

Very cool! 😄 Looking forward to see how Spiel progresses

authors: JoshKarpel olavolav

repo: olavolav/uniplot


text:
Minigame emoji’s

🐛 Bug Report
no minigame emoji for top kc of +lb minigame rogues’ den

Closed by #2296

authors: Lilylicious Sandgen

repo: oldschoolgg/oldschoolbot


text:
2 Questions:  How to Export Sass site (developed via CodeKit)?  How to get top-bar container shadow to take on top-level z-index?

I'm having issues with trying to export a FP site I developed on my localhost using CodeKit:  I've tried both zipping the entire folder, then uploading to the live server as a theme and loading the default FP theme (same-day fresh download) then importing an old fashioned WP export of the data, then uploading my _custom-settings.scss (scss/config) and custom page files. Didn't work.
Noticed no bower components folder on the later approach, so uploaded that folder.  Still no dice.
This was all in a multisite install.
I've now set up in a separate directory a single WP install.  Sorry to be so dim (I don't typically work in WP), but how best to get my full custom FP site from localhost to this new location?  (Again, neither of the above approaches worked -- at last not on the multisite install).
SECOND QUESTION:  I have a drop shadow applied to the top-bar-container.  The section that follows, though, no matter what z-index I try to apply to it and/or the nav, sits atop the drop shadow UNTIL I start to scroll and thus the sticky class gets triggered.  Any thoughts how to have the drop shadow there at the outset?  Worked fine in the version of the site I developed without using Sass, however I was getting other errors, so I redid the site in Sass (currently a combo of Sass and straight CSS, as I'm still learning how to write certain elements in Sass; the straight CSS elements are merely for custom classes, not any main foundation.css nor settings.scss items -- at least I think not!).
If I can get the first solved, I can obviously supply a URL to help solve the second.  But at present the install gets so messed up that linking to it I don't think will provide any useful information.  Thanks!

Here is the single-site install I got to work a bit better (did the zip install as the theme, then imported the data):  No idea why everythign is jigged down???  http://www.pixel-relish.com/wp2/

If you make .top-bar-container position relative and with a z-index of 2 it looks like it fixes the issue, you'd have to find a way to remove those styles upon scrolling which should be easy to do.

Interesting idea:  I tried exactly that but using a high z (1000) and it didn't work.  I will try the 2 later today and let you know. Thanks.

Jquery Waypoints can assign different CSS classes to objects based on scroll-positions, maybe worth a look?

@PixelRelish : make sure you apply the z-index value to the correct div class. I tried this, and it seemed to work just fine.

@PixelRelish the position: relative; is what is going to help the browser know how to stack things, so it could be that you just need to add that an any z-index.

Perhaps the issue was that I was trying to write into custom-settings.scss and it seemed to be getting overwritten.  (I did indeed add position: relative, too, in my original attempts.)  If I add directly to foundation.css, won't the styles get overwritten when I later update FoundationPress?  This is my first Sass site, so please excuse my ignorance.  Do I write your above media="all"... styles into custom-settings.scss, say, near the bottom of the page (does page order even matter with scss?  I guess not, that the importer dictates the actual final css order, yes?)

Yes, that seems to have worked.  No idea how I messed up something so simple.  Thank you both for your help.

Any time, FoundationPress rules!

authors: FlatspinZA LukePettway PixelRelish olefredrik

repo: olefredrik/FoundationPress


text:
here call two times ZSTD_copy16 wont be bug?

in source of ZSTD_wildcopy  method,here call two times ZSTD_copy16(op, ip)wont be bug?
https://github.com/oleg-st/ZstdSharp/blob/b15b543ef7ea35b957f69af15988c4bfdad607d6/src/ZstdSharp/Unsafe/ZstdInternal.cs#L364
And the result of my test on Windows is: ZSTD_wildcopy seems to be slower than Unsafe.CopyBlockUnaligned.
In debug mode: I operated a 2488x2048 32-bit image. Each row of data was copied through memory.
ZSTD_wildcopy need 20ms
Unsafe.CopyBlockUnaligned need 4ms

2 calls ported from here. Also ZSTD_wildcopy takes into account possible buffer overlap.

It seems then that this function is not suitable for normal copying.

authors: oleg-st sgf

repo: oleg-st/ZstdSharp


text:
vs2015 can not open the project

I am a chinese developer, vs2015 can not open the project, need some help

sorry, I find it. https://marketplace.visualstudio.com/search?term=T4Toolbox&target=VS&category=All categories&vsVersion=&sortBy=Relevance


text:
Clean up documenting norms

whoops didn't see that this had been closed, just added our docs in separate files and reorged some stuff

Wait, not green head! What if this fails tests??

Wait, not green head! What if this fails tests??
haha hi -berwin

so true! resolved, switched to true head

Phew! Glad it's going to the right place now 😌

authors: berwinlan hnvakil

repo: olincollege/noodlemaps


text:
NewTermsQuery can not use?

Please use the following questions as a guideline to help me answer
your issue/question without further inquiry. Thank you.
Which version of Elastic are you using?
[ ] elastic.v7 (for Elasticsearch 7.x)
[X ] elastic.v6 (for Elasticsearch 6.x)
[ ] elastic.v5 (for Elasticsearch 5.x)
[ ] elastic.v3 (for Elasticsearch 2.x)
[ ] elastic.v2 (for Elasticsearch 1.x)
Please describe the expected behavior
i want to creat a query like this :
{
"query": {
"bool": {
"filter": {
"range": {
"@timestamp": {
"from": "2020-07-02T07:51:16.364095Z",
"include_lower": false,
"include_upper": true,
"to": null
}
}
},
"must": [{
"term": {
"datatype.keyword": "cluster"
}
}, {
"terms": {
"clusterName.keyword": ["a", "b", "c"]
}
}
]
}
}
}
so i use a NewTermsQuery func, the values is a string slice ,not always ensure len, so i give this function values like []string{"a","b", "c"}, i want is  "terms": { "clusterName.keyword": ["a", "b", "c"]  },  but i got this "terms": { "clusterName.keyword": [ ["a", "b", "c"] ] } , and the query failed with : [terms] unknown token [END_ARRAY] after [clusterName.keyword], is that ok to use?
Please describe the actual behavior
Any steps to reproduce the behavior?

You probably want something like this. HTH.

authors: admanheart olivere

repo: olivere/elastic


text:
Fix labels

Fix labels according to olivertwistor/olivertwistor-project-model#29, olivertwistor/olivertwistor-project-model#31 and olivertwistor/olivertwistor-project-model#35.

Done.

Done.

Done.

repo: olivertwistor/todo-list-tools


text:
onChangeIndex callback  with animation lag  while sliding

Hello
When I put a callback for SwipeableViews, there is a lag in animation while sliding
<SwipeableViews style={styles.slideContainer}
       onChangeIndex={this.props.actions.introSlider}
       threshold={0}>
....
....
</SwipeableViews>

introSlider() {
   let slideIndex = 'slide'+ (index + 1)
   let circleIconfont = {
      slide1: 'circle-o',
      slide2: 'circle-o',
      slide3: 'circle-o'
    }
    circleIconfont[slideIndex] = 'circle'
}

introSlider slider basically makes dot dot dot on slide
Thanks
Bikash

What's the expected behavior and the current behavior?

@oliviertassinari Thanks for the reply...
The issue is with swipe transition being laggy - when I swipe the slider view, the event onChangeIndex is called which calls the function introSlider() there I have  logic written to toggle the slider dots (causing a re-render of view)  which makes the slider bit laggy and the transition from left - right not so smooth as compared to if we don't have the onChangeIndex callback

Oh right, thanks for providing more details. So you are experiencing some junks. Basicaly, it's user responsability to avoid wasted rerendering. You can have a look at https://github.com/oliviertassinari/react-swipeable-views/blob/master/README.md#performance-on-browser.
I'm closing the issue. Feel free to improve the docs if you find anything unclear.

authors: bikashsharmabks oliviertassinari

repo: oliviertassinari/react-swipeable-views


text:
feat: ability to create/manage agents similar to GPTs

It would be great to have the ability to create/edit/delete agents with specific system prompts to function similarly to OpenAI's GPTs framework.

Hi, I'm planning on adding this feature in a near future, so stay tuned for the upcoming updates. Let's continue our discussion here #114. Thanks.

authors: jeremiahsb tjbck

repo: ollama-webui/ollama-webui


text:
ResponseError(without error information) when running with python

simple codes like below
ollama.chat(model='mistral:instruct', messages=[{'role': 'user', 'content': 'Why is the sky blue?'}])
OR
import ollama
response = ollama.chat(model='mistral:instruct', messages=[
  {
    'role': 'user',
    'content': 'Why is the sky blue?',
  },
])
print(response['message']['content'])`

An error is being thrown, but there is no specific issue being printed.
"It works perfectly fine in the command-line interface (CLI) when I run ollama run mistral:instruct
Here is the error
ResponseError                             Traceback (most recent call last)
Cell In[2], [line 1](vscode-notebook-cell:?execution_count=2&line=1)
----> [1](vscode-notebook-cell:?execution_count=2&line=1) ollama.chat(model='mistral:instruct', messages=[{'role': 'user', 'content': 'Why is the sky blue?'}])

File [~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:177](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:177), in Client.chat(self, model, messages, stream, format, options, keep_alive)
    [174](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:174)   if images := message.get('images'):
    [175](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:175)     message['images'] = [_encode_image(image) for image in images]
--> [177](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:177) return self._request_stream(
    [178](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:178)   'POST',
    [179](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:179)   '[/api/chat](https://file+.vscode-resource.vscode-cdn.net/api/chat)',
    [180](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:180)   json={
    [181](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:181)     'model': model,
    [182](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:182)     'messages': messages,
    [183](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:183)     'stream': stream,
    [184](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:184)     'format': format,
    [185](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:185)     'options': options or {},
    [186](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:186)     'keep_alive': keep_alive,
    [187](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:187)   },
    [188](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:188)   stream=stream,
    [189](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:189) )

File [~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:97](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:97), in Client._request_stream(self, stream, *args, **kwargs)
     [91](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:91) def _request_stream(
     [92](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:92)   self,
     [93](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:93)   *args,
     [94](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:94)   stream: bool = False,
     [95](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:95)   **kwargs,
     [96](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:96) ) -> Union[Mapping[str, Any], Iterator[Mapping[str, Any]]]:
---> [97](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:97)   return self._stream(*args, **kwargs) if stream else self._request(*args, **kwargs).json()

File [~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:73](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:73), in Client._request(self, method, url, **kwargs)
     [71](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:71)   response.raise_for_status()
     [72](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:72) except httpx.HTTPStatusError as e:
---> [73](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:73)   raise ResponseError(e.response.text, e.response.status_code) from None
     [75](https://file+.vscode-resource.vscode-cdn.net/Users/kaleemullahqasim/Documents/GitHub/upwork_Sentiment_job/~/Documents/GitHub/upwork_Sentiment_job/.venv/lib/python3.12/site-packages/ollama/_client.py:75) return response

ResponseError:`

I met the same question, debugged the code and found that the error code is 502, I tried to find the place where the response is generated but the code wrapped too deep and is hard to locate precisely.
So I tried to use the python packge request directly and succeeded, here is the code:
import requests
import json

url = "http://localhost:11434/api/chat"
data = {
    "model": "phi3",
    "messages": [
        {
            'role': 'user',
            'content': 'Why is the sky blue?',
        }
    ],
    "stream": False
}

response = requests.post(url, json=data)

if response.status_code == 200:
    response_data = response.json()
    print(json.dumps(response_data, indent=4))
else:
    print(f"status_code{response.status_code}")
    print(response.text)

here is the result:
{
    "model": "phi3",
    "created_at": "2024-05-25T14:55:39.889174Z",
    "message": {
        "role": "assistant",
        "content": " The sky appears blue to the human eye because of a phenomenon called Rayleigh scattering. As sunlight travels through Earth's atmosphere, it encounters molecules and small particles which scatter the light in all directions. Blue light has a shorter wavelength and is scattered more than other colors since it travels as shorter, smaller waves. This selective scattering causes the sky to look blue in the daytime. However, at sunrise and sunset, the light passes through more of Earth's atmosphere, which scatters away most of the blue light, allowing reds, oranges, and yellows to dominate our view."
    },
    "done_reason": "stop",
    "done": true,
    "total_duration": 5341346800,
    "load_duration": 2678940100,
    "prompt_eval_count": 13,
    "prompt_eval_duration": 61936000,
    "eval_count": 139,
    "eval_duration": 2598396000
}

authors: AboidoLiven Kaleemullahqasim

repo: ollama/ollama-python