-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
ERROR: Argument is of incorrect size in Dict at dict.jl:228 #2402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Nucleotide is an 8-bit bitstype defined here: https://github.com/diegozea/BioSeq.jl/blob/master/src/nucleotide.jl#L3 |
Looks like the problem is with the convert between Char and Nucleotide
I defined the convert rule on the next way:
I don't see the problem. Worked fine in the past. |
Maybe is because of this: 24268cc |
As you pointed out, the trunc8 intrinsic was removed from the language in 24268cc in favor of using trunc_int. |
The fact that Nucleotide is a subtype of something called ASCIIChar is so jarringly wrong, I have a hard time getting past it, never mind that an eight bit char type makes no sense in Julia's string system in the first place. Yes, the trunc8 intrinsic is gone. This kind of thing is why I recommended converting to Uint8 and then relying on the predefined behavior of that. Intrinsics are not really part of Julia's stable API, but rather a means for the system to bootstrap itself. As soon as the immutable branch gets merged, there will be even less call to use intrinsics for this. |
Thanks @pao, I need to do the @StefanKarpinski, would you recommended to me do with this? The problem with ASCIIChar is the name, or all the idea of get Char's functions on an 8-bits bitetype? I open this issue on BioSeq in order to don't make noise here: diegozea/BioSeq.jl#1 |
A nucleotide is not a character. They're completely unrelated things. If it's convenient to allow transparent conversion between characters and nucleotides, that's fine, but making Nucleotide an actual subtype of ASCIIChar makes no sense. How is ASCIIChar even an abstract type? What? Char isn't abstract. How is ASCIIChar abstract? The very concept of ASCIIChar is nonsensical: a character doesn't have an encoding, a string does. A string is an encoded representation of a sequence of characters: the characters are the encoded values – they themselves don't have an encoding. The phrase "ASCII character" is just used to mean "characters that can be encoded by ASCII". Historically, strings happened to be a convenient way to represent nucleotides in languages that didn't have the tools to make a proper representation. Here, in a language that gives you every possible tool to do this the right way, I see |
@StefanKarpinski I didn't ignore your advise! |
I do appreciate all your hard work on this and the amount of time you've spent working on this and other Julia code. I'm not angry at all, but rather frustrated. The frustration stems from my sense that you have repeatedly asked what the best way to do something is, gotten advice that wasn't what you had in mind, and then done the complete opposite. Early on, I wrote the following on the subject of whether you should represent DNA sequences using strings and characters:
I would say that's a pretty clear "no, don't use strings and characters to represent DNA sequences". Now we have DNA sequences represented as strings and characters. Later on, on the subject of how to implement the Char8 type, which I clearly said shouldn't exist at all, I recommended against copying all the intrinsics in char.jl, saying specifically:
Instead, Char8 is implemented using intrinsics. Perhaps I was unclear, or I'm too verbose, or you just chose to pay more attention to other simpler statements, but in any case, this is where my frustration comes from. But that's ok. I don't expect everyone to do things the way I suggest, nor would I want that to be the case. Perhaps we can take another shot at this stuff once the immutable branch gets merged, since that will allow a much simpler representation of a nucleotide using an immutable composite type. |
@StefanKarpinski I need some hints on how you think such abstraction can be. I have problems on the past, because AbstractArray and String interface are not the same, and I don't have the ability for inherit from both. So, I try using both (using a Composite type as container), and I feel that AbstractArray is much better. So, I choose using Array (and for example gain the great power of SubArrays and DArrays!!!) and I define every method for work on Strings too. Is There other way? After your words of no-opting Strings, because immutability and others, I think user don't have to use ASCIIString as a Sequences. Because of that, in some moment, I thought don't offer an interface for Strings. But... What do you think? |
Sorry for the slow reply – yesterday was a bit of a short/busy day for me. For now, I think that making your own bits type and having arrays of those is the best way forward. There is already some overlap in the interfaces of strings and arrays, but that is an area where we definitely need more work. Fortunately, duck typing is the ultimate polymorphic escape hatch – even when you can't coinherit, you can always just duck type. I see you've already made some specific changes, so I'll leave comments there instead... |
This should include the recent `is_stdlib()` fixes. Short commit log: ``` 7a9d9654 (HEAD -> master, origin/master, origin/HEAD) [ext/HSG]: Store next release _and_ latest nightly (#2418) 7b870924 [ext/HSG]: Enable generating historical stdlibs on macOS (#2417) 5d496193 Update Project.toml feada149 only use the stdlib version cache if a custom version is given to the resolver bae808dc Fix Markdown table formatting (#2416) 6e8b6214 Update docstrings for io kwargs, some io kwarg fixes, update stdlib list (#2402) c2e3879e Mark the "STDLIBS_BY_VERSION up-to-date" test as broken (#2409) ```
This should include the recent `is_stdlib()` fixes. Short commit log: ``` 7a9d9654 (HEAD -> master, origin/master, origin/HEAD) [ext/HSG]: Store next release _and_ latest nightly (#2418) 7b870924 [ext/HSG]: Enable generating historical stdlibs on macOS (#2417) 5d496193 Update Project.toml feada149 only use the stdlib version cache if a custom version is given to the resolver bae808dc Fix Markdown table formatting (#2416) 6e8b6214 Update docstrings for io kwargs, some io kwarg fixes, update stdlib list (#2402) c2e3879e Mark the "STDLIBS_BY_VERSION up-to-date" test as broken (#2409) ```
This should include the recent `is_stdlib()` fixes. Short commit log: ``` 7a9d9654 (HEAD -> master, origin/master, origin/HEAD) [ext/HSG]: Store next release _and_ latest nightly (JuliaLang#2418) 7b870924 [ext/HSG]: Enable generating historical stdlibs on macOS (JuliaLang#2417) 5d496193 Update Project.toml feada149 only use the stdlib version cache if a custom version is given to the resolver bae808dc Fix Markdown table formatting (JuliaLang#2416) 6e8b6214 Update docstrings for io kwargs, some io kwarg fixes, update stdlib list (JuliaLang#2402) c2e3879e Mark the "STDLIBS_BY_VERSION up-to-date" test as broken (JuliaLang#2409) ```
This should include the recent `is_stdlib()` fixes. Short commit log: ``` 7a9d9654 (HEAD -> master, origin/master, origin/HEAD) [ext/HSG]: Store next release _and_ latest nightly (JuliaLang#2418) 7b870924 [ext/HSG]: Enable generating historical stdlibs on macOS (JuliaLang#2417) 5d496193 Update Project.toml feada149 only use the stdlib version cache if a custom version is given to the resolver bae808dc Fix Markdown table formatting (JuliaLang#2416) 6e8b6214 Update docstrings for io kwargs, some io kwarg fixes, update stdlib list (JuliaLang#2402) c2e3879e Mark the "STDLIBS_BY_VERSION up-to-date" test as broken (JuliaLang#2409) ```
This works fine on Julia 0.1, but fails on a most recent version
( Version 0.1.0+110766073.r3778 ):
The text was updated successfully, but these errors were encountered: