Skip to content
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

mup2argmap: bad argument #1 to 'for iterator' (table expected, got nil) #13

Open
s6mike opened this issue Jun 24, 2022 · 7 comments
Open
Labels
bug Something isn't working #next

Comments

@s6mike
Copy link
Owner

s6mike commented Jun 24, 2022

Although this worked fine: lua mup2argmap Output/example.mup > Output/example1.yml

This didn't:
lua mup2argmap Input/Example1_ClearlyFalse_WhiteSwan.mup > Output/WhiteSwan.yml

- lua: ./mup2argmap:34: bad argument 1 to 'for iterator' (table expected, got nil)
- stack traceback:
  - [C]: in function 'next'
  - ./mup2argmap:34: in function 'parse_claims'
  - ./mup2argmap:65: in function 'parse_reasons'
  - ./mup2argmap:43: in function 'parse_claims'
  - ./mup2argmap:65: in function 'parse_reasons'
  - ./mup2argmap:43: in function 'parse_claims'
  - ./mup2argmap:65: in function 'parse_reasons'
  - ./mup2argmap:43: in function 'parse_claims'
  - ./mup2argmap:65: in function 'parse_reasons'
  - ./mup2argmap:43: in function 'parse_claims'
  - ./mup2argmap:111: in function 'main'
  - ./mup2argmap:129: in main chunk
  - [C]: in ?
@s6mike s6mike added the #next label Jun 25, 2022
@s6mike
Copy link
Owner Author

s6mike commented Jun 25, 2022

If mup2argmap wrote to file incrementally, might be easier to debug, could look at output file?

@s6mike
Copy link
Owner Author

s6mike commented Jun 25, 2022

For 'The colour of doves and seagulls is not relevant to the colour of swans.'

Looks like type should be opposing, but isn't?

Opposing part it is 3 level, rather than 1. But perhaps it's working as it should

  "3": {
                            "title": "group",
                            "id": "111.39c0.20fcbfa62-22a5.8d66050d3",
                            "attr": {
                                "contentLocked": true,
                                "group": "opposing"
                            },
"ideas": {
                                "1": {
                                    "title": "The colour of doves and seagulls is not relevant to the colour of swans.",
                                    "id": "112.39c0.20fcbfa62-22a5.8d66050d3",
                                    "attr": {}
                                },
                                "2": {
                                    "title": "These statements do not logically lead to the conclusion that all swans are white.",
                                    "id": "90.284b.9e18170f5-2dfc.554a800f5",
                                    "attr": {},
                                    "ideas": {}
                                }
                            }
                        },

@s6mike
Copy link
Owner Author

s6mike commented Jun 25, 2022

Error thrown by line 65:
parse_claims(items["ideas"], strength, label)

Error thrown by line 34:
local claims = parse_claims(items["ideas"], strength, label)

Label: X
key:o1

id:
'14.7233.0a46019f3-35f8.fe2f2c911'
ideas:
{1=...}
title:
'This black swan is a photo-shopped fake.'

/home/s6mike/git_projects/argmap/mup2argmap:34: bad argument #1 to 'for iterator' (table expected, got nil)

@s6mike
Copy link
Owner Author

s6mike commented Jun 25, 2022

Try removing 'This black swan is a photo-shopped fake.' from map then export

@s6mike
Copy link
Owner Author

s6mike commented Jun 26, 2022

Removing the within argument objections, plus the note added to the objection, seems to fix issue. See https://drive.mindmup.com/map/1FY98eeanu9vAhIqBG1rDKFs3QyM1uQyY, which works.

Also see: Example1_ClearlyFalse_WhiteSwan_minus_inline_objections in which I think I've included everything I can from the original example without throwing an error.

Though output is still a bit flakey in places:

All swans are white.:
  r**-1**:
    label: supports (+)
    These swans are representative of all swans.:
      o5:
        label: X
        **? |-**
          # Logical Fallacy

          Observing individuals doesn't prove anything about the whole population.
        : note: Observing individuals doesn't prove anything about the whole population.
    Every swan I've ever seen is white.:
      r1:
        label: +
        Here is a photo of another white swan.: []
        Here is a photo of a white swan.:
          r1: []
  o1:
    label: rejects (X)
    strength: 5
    Not all swans are white.:
      r1:
        label: +
        strength: 5
        **? |-**
          This is a photo of a black swan from Australia.

          https://en.wikipedia.org/wiki/Black_swan
        : o1:
            label: X
            This black swan is a photo-shopped fake.: []
  r2:
    label: supports (+)
    strength: 1
    Every seagull I've ever seen is white. :
      o3:
        label: X
        This isn't relevant to the argument of whether all swans are white.: []
    Every dove I've ever seen is white.:
      o1:
        label: X
        This colour of doves is not relevant to the colour of swans.: []
...

@s6mike
Copy link
Owner Author

s6mike commented Jun 26, 2022

Running argmap2mup on above gave a file which didn't work in mindmup, but produced this using legacy mapjs:
image

Issues: has encoding errors. Otherwise - missing images, but no structural differences.

@s6mike s6mike added the bug Something isn't working label Jul 2, 2022
@s6mike
Copy link
Owner Author

s6mike commented Oct 30, 2022

Similar (and more recent):

m2a test/input/mapjs-json/example2-clearly-false-white-swan-v3.mup
lua: /opt/miniconda3/envs/argmap/bin/mup2argmap:53: bad argument #1 to 'for iterator' (table expected, got nil)
stack traceback:
        [C]: in function 'next'
        /opt/miniconda3/envs/argmap/bin/mup2argmap:53: in function 'parse_claims'
        /opt/miniconda3/envs/argmap/bin/mup2argmap:87: in function 'parse_reasons'
        /opt/miniconda3/envs/argmap/bin/mup2argmap:62: in function 'parse_claims'
        /opt/miniconda3/envs/argmap/bin/mup2argmap:87: in function 'parse_reasons'
        /opt/miniconda3/envs/argmap/bin/mup2argmap:62: in function 'parse_claims'
        /opt/miniconda3/envs/argmap/bin/mup2argmap:133: in function 'main'
        /opt/miniconda3/envs/argmap/bin/mup2argmap:152: in main chunk
        [C]: in ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working #next
Projects
None yet
Development

No branches or pull requests

1 participant