[Bug]: ValueError: Cannot generate bounds for a coordinate of length <= 1. Using decode_times optional arg

What happened?
Attempting to open a dataset with time:units = "months since 1955-01-01 00:00:00" ; has problems, adding decode_times=False gets around the pandas issue (#282), but this leads to a xcdat/bounds.py issue instead: ValueError: Cannot generate bounds for a coordinate of length <= 1.
What did you expect to happen?
xcdat could handle the poorly formed file and open the dataset.
Minimal Complete Verifiable Example
In [2]: from xcdat import open_dataset

In [3]: f = "~/Shared/obs_data/WOD18/190312/woa18_decav_t00_04.nc"

In [4]: wH = open_dataset(f)

Or

In [5]: wH = open_dataset(f, decode_times=False)

Relevant log output
Traceback (most recent call last):

  File "/tmp/ipykernel_177169/1773024523.py", line 1, in <cell line: 1>
    wH = open_dataset(f)

  File "~/mambaforge/envs/xcdat030spy532/lib/python3.10/site-packages/xcdat/dataset.py", line 89, in open_dataset
    ds = decode_non_cf_time(ds)

  File "~/mambaforge/envs/xcdat030spy532/lib/python3.10/site-packages/xcdat/dataset.py", line 320, in decode_non_cf_time
    data = [ref_date + pd.DateOffset(**{units: offset}) for offset in time.data]

  File "~/mambaforge/envs/xcdat030spy532/lib/python3.10/site-packages/xcdat/dataset.py", line 320, in <listcomp>
    data = [ref_date + pd.DateOffset(**{units: offset}) for offset in time.data]

  File "pandas/_libs/tslibs/offsets.pyx", line 444, in pandas._libs.tslibs.offsets.BaseOffset.__add__

  File "pandas/_libs/tslibs/offsets.pyx", line 450, in pandas._libs.tslibs.offsets.BaseOffset.__add__

  File "pandas/_libs/tslibs/offsets.pyx", line 180, in pandas._libs.tslibs.offsets.apply_wraps.wrapper

  File "pandas/_libs/tslibs/offsets.pyx", line 1092, in pandas._libs.tslibs.offsets.RelativeDeltaOffset._apply

  File "pandas/_libs/tslibs/timestamps.pyx", line 1399, in pandas._libs.tslibs.timestamps.Timestamp.__new__

  File "pandas/_libs/tslibs/conversion.pyx", line 436, in pandas._libs.tslibs.conversion.convert_to_tsobject

  File "pandas/_libs/tslibs/conversion.pyx", line 517, in pandas._libs.tslibs.conversion.convert_datetime_to_tsobject

  File "pandas/_libs/tslibs/np_datetime.pyx", line 120, in pandas._libs.tslibs.np_datetime.check_dts_bounds

OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 2315-07-01 00:00:00

In [5]: wH = open_dataset(f, decode_times=False)
Traceback (most recent call last):

  File "~/mambaforge/envs/xcdat030spy532/lib/python3.10/site-packages/xcdat/bounds.py", line 178, in get_bounds
    bounds_key = coord_var.attrs["bounds"]

KeyError: 'bounds'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "~/mambaforge/envs/xcdat030spy532/lib/python3.10/site-packages/xcdat/bounds.py", line 145, in add_missing_bounds
    self.get_bounds(axis)

  File "~/mambaforge/envs/xcdat030spy532/lib/python3.10/site-packages/xcdat/bounds.py", line 180, in get_bounds
    raise KeyError(

KeyError: "The coordinate variable 'time' has no 'bounds' attr. Set the 'bounds' attr to the name of the bounds data variable."

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "~/mambaforge/envs/xcdat030spy532/lib/python3.10/site-packages/xcdat/bounds.py", line 178, in get_bounds
    bounds_key = coord_var.attrs["bounds"]

KeyError: 'bounds'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "~/mambaforge/envs/xcdat030spy532/lib/python3.10/site-packages/xcdat/bounds.py", line 220, in add_bounds
    self.get_bounds(axis)

  File "~/mambaforge/envs/xcdat030spy532/lib/python3.10/site-packages/xcdat/bounds.py", line 180, in get_bounds
    raise KeyError(

KeyError: "The coordinate variable 'time' has no 'bounds' attr. Set the 'bounds' attr to the name of the bounds data variable."

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "/tmp/ipykernel_177169/170555424.py", line 1, in <cell line: 1>
    wH = open_dataset(f, decode_times=False)

  File "~/mambaforge/envs/xcdat030spy532/lib/python3.10/site-packages/xcdat/dataset.py", line 95, in open_dataset
    ds = _postprocess_dataset(ds, data_var, center_times, add_bounds, lon_orient)

  File "~/mambaforge/envs/xcdat030spy532/lib/python3.10/site-packages/xcdat/dataset.py", line 482, in _postprocess_dataset
    dataset = dataset.bounds.add_missing_bounds()

  File "~/mambaforge/envs/xcdat030spy532/lib/python3.10/site-packages/xcdat/bounds.py", line 147, in add_missing_bounds
    self._dataset = self.add_bounds(axis, width)

  File "~/mambaforge/envs/xcdat030spy532/lib/python3.10/site-packages/xcdat/bounds.py", line 225, in add_bounds
    dataset = self._add_bounds(axis, width)

  File "~/mambaforge/envs/xcdat030spy532/lib/python3.10/site-packages/xcdat/bounds.py", line 271, in _add_bounds
    raise ValueError("Cannot generate bounds for a coordinate of length <= 1.")

ValueError: Cannot generate bounds for a coordinate of length <= 1.

Anything else we need to know?
 I think xcdat 0.3.1 may fix the first issue, but I'm not sure why the second issue is occurring.

This should get you there, although I have this data local too
https://www.ncei.noaa.gov/thredds-ocean/catalog/ncei/woa/temperature/decav/0.25/catalog.html?dataset=ncei/woa/temperature/decav/0.25/woa18_decav_t00_04.nc

The file can be downloaded from here.
I think the time units issue is fixed with this PR. The bounds issue is because this file has one time step and xcdat can't figure out how to generate bounds in that case.
I think a reasonable fix would be to modify this line to log a warning and return the dataset as is.

@pochedls sure thing - happy to be a test bunny.
I did pull down and create an xcdat_dev env last night following the instructions from https://xcdat.readthedocs.io/en/stable/contributing.html#local-development and attempted to build the env using bump/0.3.1 but hit issues with xesmf.py - didn't log these as it's not a released/main branch.
As an aside, I was keen to pull down the changes in bump/0.3.1 and give this a whirl, but was stumped. I know this is not merged into main, but in a situation where it was, a nightly conda build would be VERY helpful

I did pull down and create an xcdat_dev env last night following the instructions from xcdat.readthedocs.io/en/stable/contributing.html#local-development and attempted to build the env using bump/0.3.1 but hit issues with xesmf.py - didn't log these as it's not a released/main branch.

This is fixed by #307.

As an aside, I was keen to pull down the changes in bump/0.3.1 and give this a whirl, but was stumped. I know this is not merged into main, but in a situation where it was, a nightly conda build would be VERY helpful

As mentioned, this is not merged into main yet and is blocked by other PRs. It should be correctly labeled as "Draft PR".
We decided to go for rapid release cycles over nightly conda builds. Will provide a follow up the reasoning for this decision in https://github.com/xCDAT/xcdat/discussions/269 soon.

@durack1 - would you be willing to try a PR on this (assuming @tomvothecoder agrees with this solution)? The contributing guide is pretty complete (and would give you the latest xcdat environment since you would like to use some of the bug fixes on 0.3.1).

If you are interested @durack1, I can give you write access to this repository so you don't need to work on a separate fork.

@tomvothecoder sure, hook me up!

@durack1 Just added you!

@pochedls I am running on the latest main https://github.com/xCDAT/xcdat/commit/4c51879a65992e08b29eabd2d31f7332aca78e61 in spyder and ready and waiting to test out a PR when you have one available - from the looks there's no active PR or branch that I can currently find.
Interestingly, the merge of #283 has led to the previous xarray error being replaced by an all xcdat error logs straight away, which suppresses the hint that gave me the decode_times=False tip

@durack1 - This should be fixed on the main branch.

@pochedls @tomvothecoder excellent, thanks gents. I'll pull down the latest main later this week!


Could we allow training without a connected micro:bit?

If you've already got data added to ml-machine, or you've uploaded some data, it would be nice to be able to train the model and see the 'model' page (and the eventual filters page) without having to connect a physical micro:bit
This would be great for teachers exploring the tool before they have a micro:bit - we could, for example, distribute some sample data for demo purposes. (that even worked with a simulated micro:bit input in the longer term.)

It would be simple to implement this. We could just enable the button to train the model regardless of the connection state, as we have plenty of screen real estate on the training page.
What do you think @Karlo-Emilo ?

Making it possible to train the model would be easy.
The model page would need some work. It should somehow communicate that the user must connect a micro:bit in order to "really" use the page. Otherwise, the user may think the page is broken. The page does not make sense without a connected micro:bit, but I see the point of letting teachers explore the page without a micro:bit. A simple "connect a micro:bit to use this page"-message on the page may be sufficient.
We could also make  a pre-recorded dataset available on the data page. It would probably be easier than distributing sample data.

[ ] Enable the training button, when no micro:bit is connected
[ ] Display a "connect a micro:bit to use this page" message on the model page


Add IBM Scaler Doc

Initial IBM MQ Scaler Documentation:

Trigger Specification
Authentication Parameters
Example YAML file

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.Liam McNulty seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.


Test permissioned cosmwasm

Check that we can't store a contract without a proposal
Store + instantiate a contract via proposal
Check that we can't instantiate a contract without a proposal
Check that we can't execute a contract without a proposal
Check that the contract's state didn't change when we tried to run it without permissions
Check that we can execute a contract via a proposal
Check that its state changes

https://github.com/hyphacoop/cosmos-release-testing/actions/runs/9406083476

https://github.com/hyphacoop/cosmos-release-testing/actions/runs/9449881846


No Comma3X support for release3.

Describe the bug
I bought it and installed and had my entire comma 3x bricked with Dragon Pilot. Obviously had to flash with a fast boot on Mac using chrome.
When will this be available for the Comma 3x
I believe it must be a release for 0.9.4 or above to work on Comma 3x.
If there is a release, what link should I use for the custom URL install?
Provide a route where the issue occurs
No route
openpilot version
0.9.4
Additional info
No response

Use beta3. Release3 has reached EOL. Beta3 will be replacing release3

Is there a link for the custom url install?

Is there a link for the custom url install?

https://smiskol.com/fork/dp/beta3

Super helpful Kumar!
I installed it beta3 yesterday.
Just a question, I had previously installed Sunnypilot and noticed there were a lot more controls and toggles with their build vs the beta 3.
are they just built in with Dragon Pilot or not there in the Beta 3?

Beta3 is completely code refactor. A lot of those features will come will time or being are being reworked. Also the new design idea toggle major features. Most of little will be on via default as part dragonpilot experience.


Possible addition

Hey man, just a possible addition.
I'd recommend for the database and csv handling tooling looking into
http://csvkit.readthedocs.org/en/latest/

thanks, very useful!

Hi,
Do you need me to make a PR?
On Fri, Mar 13, 2015 at 8:54 AM, Matthijs van der Kroon <
<EMAIL_ADDRESS>wrote:

thanks, very useful!
—
Reply to this email directly or view it on GitHub
https://github.com/mvanderkroon/cobr/issues/1#issuecomment-78855325.

--
Peadar Coyle
Skype: springcoilarch
www.twitter.com/springcoil
peadarcoyle.wordpress.com

I used your great suggestion to implement a POST end-point in the HttpODBC API (https://github.com/mvanderkroon/cobr/blob/master/api/HttpODBC.py); basically now accepting csv files and automatically importing them into your database. (A GET request to the same address converts the database table to a csv). Feel free to make any PR if you like the framework!

I think a PR would be too much though you've done probably the best part of
it. Maybe though I'll add csvstat or something because statistics of the
csv thing are needed.
On Wed, Mar 18, 2015 at 9:31 AM, Matthijs van der Kroon <
<EMAIL_ADDRESS>wrote:

Closed #1 https://github.com/mvanderkroon/cobr/issues/1.
—
Reply to this email directly or view it on GitHub
https://github.com/mvanderkroon/cobr/issues/1#event-257851412.

--
Peadar Coyle
Skype: springcoilarch
www.twitter.com/springcoil
peadarcoyle.wordpress.com


Syntax for local CSV file?

What is the syntax for using a local CSV file?
Looking at: https://github.com/JamieSinn/CSA-USB-Tool/blob/master/CSAUSBTool.Base/FIRSTSeason.cs#L36-38 it looks like it should be local:filename. However, when I run it with
./"CSAUSBTool(2)" local:FRCSoftware2020.csv I get the following traceback, which shows it went past that, which it shouldn't

local:FRCSoftware2020.csv
FRC9999:https://raw.githubusercontent.com/JamieSinn/CSA-USB-Tool/master/FRCSoftware9999.csv
                                                                                Unhandled Exception: System.Net.WebException: The remote server returned an erro r: (404) Not Found.
at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request )
at System.Net.WebClient.DownloadString(Uri address)
at CSAUSBTool.Base.FIRSTSeason.GetWebList(String uri) in F:\SoftwareProjects\ CSA-USB-Tool\CSAUSBTool.Base\FIRSTSeason.cs:line 44
at CSAUSBTool.Base.FIRSTSeason.GetWebList() in F:\SoftwareProjects\CSA-USB-To ol\CSAUSBTool.Base\FIRSTSeason.cs:line 31
at CSAUSBTool.CSAUSBTool..ctor(IReadOnlyList`1 args)
at CSAUSBTool.Program.Main(String[] args)

the local uri isn't getting passed down https://github.com/JamieSinn/CSA-USB-Tool/blob/master/CSAUSBTool/CSAUSBTool.cs#L31

As noted in the PR, will be changing how I handle this for the week 2 update.

Resolved as of the latest release.


Local prompts file doesn't work

I am trying to setup the local prompts as I would like to add some personal information. However, this setting doesn't work:
predefined_chat_gpt_prompts = home .. "/chatgpt-prompts/prompts.csv",

--- or
predefined_chat_gpt_prompts = "cat " .. home .. "/chatgpt-prompts/prompts.csv",

--- or
predefined_chat_gpt_prompts = "file:///" .. home .. "/packages/chatgpt-prompts/prompts.csv",

Is there a way do do that?

I am working on something adjacent. I would like to load my own custom actions using read_actions_from_file but couldn't figure it out.

Heads up that I figured out how to get custom actions by setting the config actions_path to my own customactions.json:
  -- ChatGPT plugins
  {
    "jackMort/ChatGPT.nvim",
    event = "VeryLazy",
    config = function()
      local chatgpt = require("chatgpt")
      chatgpt.setup({
        -- https://github.com/jackMort/ChatGPT.nvim/blob/df53728e05129278d6ea26271ec086aa013bed90/lua/chatgpt/config.lua#L177C5-L177C18
        actions_paths = { "~/.config/nvim/lua/config/chatgpt.customactions.json" }, -- <-- Added line
        openai_params = {
          model = "gpt-4o",
        },
        openai_edit_params = {
          model = "gpt-4o",
        },
      })
      local wk = require("which-key")
      wk.register({
        p = {
          name = "ChatGPT",
          -- all the other run commands can go here:
          a = { "<cmd>ChatGPTRun add_tests<CR>", "Add Tests", mode = { "n", "v" } },
          y = { "<cmd>ChatGPTRun fix_typos<CR>", "Fix Typos", mode = { "n", "v" } },
        },
      }, {
        prefix = "<leader>",
        mode = "v",
      })
    end,
    dependencies = {
      "MunifTanjim/nui.nvim",
      "nvim-lua/plenary.nvim",
      "nvim-telescope/telescope.nvim",
    },
  },

}

Example customactions.json: https://github.com/jackMort/ChatGPT.nvim/blob/df53728e05129278d6ea26271ec086aa013bed90/lua/chatgpt/flows/actions/actions.json
{
  "fix_typos": {
    "type": "chat",
    "opts": {
      "template": "Fix typos and only output the correct spelling in {{lang}}:\n\n{{input}}",
      "strategy": "replace",
      "params": {
        "model": "gpt-4o"
      }
    },
    "args": {
      "lang": {
        "type": "string",
        "optional": "true",
        "default": "english"
      }
    }
  }
}


Provide overload of EntityFrameworkQueryableExtensions.ForEachAsync() that accepts async lambda.

The issue, as well as the proposed solution, are described here: https://stackoverflow.com/questions/50920636/unexpected-behaviour-with-microsoft-entityframeworkcore-entityframeworkqueryable.
In a nutshell: ForEachAsync() takes Action<T> as second argument, but if I provide Func<T, Task> (async lambda) instead, the code still compiles. But obviously it will not work as expected, because the async lambdas will not be awaited.

@andrewslavin thank you for making this request here.
We are currently holding off adding new functionality to the implementation of async enumerables we use, because we hope to integrate the work on new async stream interfaces and language support in an upcoming version.
This is indeed valid feedback you should make sure is either contemplated in the spec of raise an issue in https://github.com/dotnet/csharplang/).
There are also deeper reasons having an overload of ForEachAsync that takes a Func<TElement,Task> could be a pit of failure. These are detailed in https://github.com/dotnet/reactive/issues/194#issuecomment-234262986 and are related to a high number of unnecessary Task allocations.
Other than that, if in the meanwhile you need something like this, it should be possible for you to create an extension method that does it.
Take a look at how our ForEach extension method obtains the underlying IAsyncEnumerable (note that this requires using EF Core internal API that we will break for sure in EF Core 3.0):
https://github.com/aspnet/EntityFrameworkCore/blob/2d1767e767a8446d3ed5ae6adbc9c55d6c7823d2/src/EFCore/EntityFrameworkQueryableExtensions.cs#L2867-L2871
And then you can implement a modified version of System.Interactive.Async's ForEachAsync that takes a Func<T, Task> and awaits on it on every loop:
https://github.com/dotnet/reactive/blob/5e77cabaacf2caa84916c3305524b0b566524203/Ix.NET/Source/System.Interactive.Async/ForEach.cs#L76-L89


feat: added "enabled" option

:tada: This PR is included in version 2.5.0 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket: