Hi..

How to do matrix operations in finite field in SymPy. Can anyone help....

Nisha

Nisha T M


On Sun, Jun 17, 2018 at 3:33 AM, Jason Moore <moorepa...@gmail.com> wrote:

> Something like:
>
> dir_of_this_file = os.path.dirname(os.path.realpath(__file__))
> test_data_file_path = os.path.join(dir_of_this_file, 'tests',
> 'test_examples', 'expected_output1.txt')
> with open(test_data_file_path) as f:
>     # do something with the file handle
>
> moorepants.info
> +01 530-601-9791
>
> On Sat, Jun 16, 2018 at 4:30 PM, Jason Moore <moorepa...@gmail.com> wrote:
>
>> This shows how to get absolute paths to files based on the location of
>> the file where your python code is in:
>>
>> https://stackoverflow.com/questions/5137497/find-current-
>> directory-and-files-directory
>>
>> I posted this to your PR. Do you have specific questions about the
>> stackoverflow solution? It should be adaptable to you needs.
>>
>> moorepants.info
>> +01 530-601-9791
>>
>> On Thu, Jun 14, 2018 at 11:36 AM, Nikhil Pappu <nkhlpa...@gmail.com>
>> wrote:
>>
>>> I have to read and write to files which are located in
>>> sympy/parsing/tests/test_examples in my test file test_autolev.py.
>>>
>>> This is the kind of code I am using in test_autolev.py
>>>
>>> directory = "sympy/parsing/tests/test_examples/"
>>> parse_autolev(os.path.join(*(directory+inFileName).split('/')), 
>>> os.path.join(*(directory+"output.py").split('/')))
>>> correctFile = open(os.path.join(*(directory+outFileName).split('/')), 'r')
>>> outputFile = open(os.path.join(*(directory+"output.py").split('/')), 'r')`
>>>
>>> This is passing on my PC when I run bin/test parsing but it is causing
>>> Travis errors of this sort:
>>>
>>>  File 
>>> "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/sympy-1.1.2.dev0-py2.7.egg/sympy/utilities/runtests.py",
>>>  line 1274, in _timeout
>>>     function()
>>>   File 
>>> "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/sympy-1.1.2.dev0-py2.7.egg/sympy/parsing/tests/test_autolev.py",
>>>  line 39, in test_example1
>>>     _test_examples("test1_in.txt", "expected_output1.txt")
>>>   File 
>>> "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/sympy-1.1.2.dev0-py2.7.egg/sympy/parsing/tests/test_autolev.py",
>>>  line 12, in _test_examples
>>>     correctFile = open(os.path.join(*(directory+outFileName).split('/')), 
>>> 'r')
>>> IOError: [Errno 2] No such file or directory: 
>>> 'sympy/parsing/tests/test_examples/expected_output1.txt'
>>>
>>> How can I fix this? How can I access specific files in the SymPy
>>> directories?
>>> Will using something like os.path.abspath() or os.getcwd() work?
>>> Also, tests seem to be run using utilities/runtests.py in Travis while I
>>> use bin/test on my PC. Would that make any difference?
>>> What would be the best way to do this type of thing?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "sympy" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to sympy+unsubscr...@googlegroups.com.
>>> To post to this group, send email to sympy@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/sympy.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/sympy/8fe0f4fd-27ff-409c-bff6-1acc2bfd8229%40googlegroups.com
>>> <https://groups.google.com/d/msgid/sympy/8fe0f4fd-27ff-409c-bff6-1acc2bfd8229%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/sympy/CAP7f1Ah6b%2BQ4E%2BnK27opTTMs-QfdJ%2BHe_W%3DCG-
> XyLwO8XKw9TQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/sympy/CAP7f1Ah6b%2BQ4E%2BnK27opTTMs-QfdJ%2BHe_W%3DCG-XyLwO8XKw9TQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAL2d9DCxhADKEgFzz3nQgvqXAX%3DAEKrco0p%3D7%3Dx9NiwPG123jg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to