Parsing of .flt file

4 views
Skip to first unread message

ravina singla

unread,
Feb 3, 2016, 2:23:17 AM2/3/16
to lugg...@googlegroups.com
axisymm.flt
flt.py

ravina singla

unread,
Feb 3, 2016, 9:02:17 AM2/3/16
to lugg...@googlegroups.com
Sir,
Please check these files. Is the work is correct or not.I have done
the parsing of a single file.

On Tue, Feb 2, 2016 at 11:23 PM, ravina singla <ravinas...@gmail.com> wrote:
>
>
> --
> Whether you think you can or you cannot you are absolutely right.
> ---
> You received this message because you are subscribed to the Google Groups "Linux User Group , Ludhiana" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to luggndec+u...@googlegroups.com.
> Visit this group at https://groups.google.com/group/luggndec.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/luggndec/CACxSyEUu74y%3DTuaFBq3tWr5o0U7gmXEgW-ZMF5GHGy5nr1o40w%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

H.S.Rai

unread,
Feb 3, 2016, 9:29:29 AM2/3/16
to lugg...@googlegroups.com
On Wed, Feb 3, 2016 at 7:32 PM, ravina singla <ravinas...@gmail.com> wrote:
>
> Please check these files. Is the work is correct or not.I have done
> the parsing of a single file.

The correct way show coded files is to use BitBucket.


> On Tue, Feb 2, 2016 at 11:23 PM, ravina singla <ravinas...@gmail.com> wrote:
>>
>> Whether you think you can or you cannot you are absolutely right.

+1

--
H.S.Rai

gagan

unread,
Feb 3, 2016, 12:08:09 PM2/3/16
to luggndec
On Wed, Feb 3, 2016 at 7:32 PM, ravina singla <ravinas...@gmail.com> wrote:
> Sir,
> Please check these files. Is the work is correct or not.I have done
> the parsing of a single file.

Hi Ravina,

Nice to see you working on FElt. Was my favourite work in past time.

Looking at your parser, I realize that everything is hard coded.

This parser will only work for this file and none other.

Instead of taking some file as an example, try reading the FElt file reference.

For example from your script,

Lets just consider constraints, in your script, you create code from
line 60 to 74 to just read two constraints, but its not necassary at
all to have just two constraints, there can be even 6-7 or many ( not
remembering exact, its quite old I touched the code ). So if there is
a file with 5 constraints, it will not work. Better create a function.
for constraints.

Further even in constraints, you have used just Tx and TY where as
there can be Tz also or there might not be Ty/Tx nothing is fixed.

I mean everything is hard coded, you are reading data at specific line
numbers, I just added a few newlines

and I got errors

https://gist.github.com/gaganjyot/3be7c6b933789bac62a2

So think generic and not fixed to file, you can get the felt file
reference, please refer that.

If you got some other questions feel free to ask here, I'll try to
sort them as much as possible.

But next time please follow a some advice,

1) Follow Coding standards, Since you are using python, PEP - 8 is great,

https://www.python.org/dev/peps/pep-0008/

2) Provide Comments. Better if you tell what, why and how you did it.

3) As sir said, use some code sharing service, if its a single or two
files, even gist is great.

4) Think modularisation, try to create functions. Create a sweet API.

For example,

a good program, I'll import it in my file and use just functions as

felt_file = open_felt_file("filename")

prob_desc = felt_file.get_prob_description()

nodes_list = felt_file.get_nodes()

constraints_list = felt_file.get_constraints_list()

This would look beautiful, easy to understand, easy to use and totally
abstracted from user how are you getting the data.

And last, you are using python and python doesn't require semi colons
at ending. ;-)

Hope that helps. :)

--
Thanks
Gaganjyot
"Jai Sai Naath"
Reply all
Reply to author
Forward
0 new messages