Commit new files to trunk

Asked by Klaus Thoeni

Hi guys!

I created my own contact law and I wanted to put it under version control. I am working on the trunk and I am wondering if I can add and commit my files to the trunk version of yade. How does it work? Will the files be reviewed (would be nice to get some feedback)?

Thanks

Klaus

Question information

Language:
English Edit question
Status:
Expired
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Václav Šmilauer (eudoxos) said :
#1

Hi Klaus, just add it (with bzr add yourfile) and commit upstream (bzr qcommit (if you have qbzr installed) or bzr commit -m ...);I will have a look, and someone else will as well, I am sure. Cheers!

PS if you checked out the branch over http (without setting ssh key at launchpad etc), you might need to run bzr bind lp:yade before commit, otherwise you will get an error message saying that HTTPTransport does not support write access or something similar.

Revision history for this message
Klaus Thoeni (klaus.thoeni) said :
#2

Hi Vaclav!

I used bzr checkout lp:yade to get my "working copy" (I am familiar with subversion). I know there is something like bzr branch lp:yade as well, should I use this command?

Anyway, how can I make a diff against the trunk before doing an update (to see what other have changed)? My ssh key is registered on launchpad. I am using Bazaar Explorer.

Thanks

Klaus

Revision history for this message
Václav Šmilauer (eudoxos) said :
#3

diff: bzr diff / bzr qdiff / ...

checkout vs. branch: http://wiki.bazaar.canonical.com/CheckoutTutorial

HTH, v. :-)

Revision history for this message
Václav Šmilauer (eudoxos) said :
#4

Hi Klaus, before commiting, run yade-* --test to make sure regression tests pass. In your case, WireMat does not save/load cleanly. postLoad function must not fail even if the class if only default-constructed -- for instance, you can test if(StrainStressValue.empty()) return;

Second thing, please start attribute names with lowerCase; I think this convention is generally used for both c++ and python, CapitalizedNames are reserved for classes.

Revision history for this message
Klaus Thoeni (klaus.thoeni) said :
#5

Hi Vaclav!

Good to know that there are some regression tests!

if(StrainStressValue.empty()) return; will fix the problem. Thanks!

Regarding attribute names, of course I can use lower case. Do I have to change 'As' as well? I saw that many classes use upper case names (e.g. see RockPM: Brittleness, G_over_E). But if you want I can change it. Any other comments or suggestions?

An other question, where can I add my test scripts related to my contact law?

Thanks

Klaus

Revision history for this message
Václav Šmilauer (eudoxos) said :
#6

Hi,

you're right that short names are fine capitalized (since there is no danger that a type would be named As; though Brittleness should be, I think, lowercased (I did not say that tthe suggestions are some hard rules or that they are followed everywhere in yade; but you asked for comments, so there you go :-) ).

I usually put such scripts to scripts/test, do the same. (It is a good candidate for cleanup btw, there is bunch of junk that does not even work anymore).

I was looking at your code only briefly. I thought that for interpolating on the piecewise-linear function, you could find the lintearInterpolate template useful (in pkg/common/LinearInterpolate.hpp); the last parameter (called "pos") it takes holds position from the last interpolation, so next time you interpolate the same function with x-value (the tt vector) which is close to the previous one, it will be very likely in that segment already, or will move just to the neigbouring segment. It could make some difference with large number of interpolations and/or large number of segments for the function.

Cheers! v.

Revision history for this message
Klaus Thoeni (klaus.thoeni) said :
#7

Hi, thanks for the very quick answer.

Regarding if(StrainStressValue.empty()) return. Regression tests are fine but it gives me a segmentation fault if the value is not initialised by the user. So I initialised it with StrainStressValues,vector<Vector2r>(1,Vector2r::Ones()) and then the regression test fails again. Can you tell me how I can fix the problem with initialising?

Thanks

Klaus

Revision history for this message
Václav Šmilauer (eudoxos) said :
#8

Hm... I would add a check to the functor that uses that material. (if(strainStressValue.empry()) throw std::invalid_argument("WireMat.strainStressValue is empty"); )

I see that there is a problem that we require postLoad to operate also on instances which are not fully initialized. For now, I don't have a good solution in mind, except for disabling that regression test. But since we did have problems with failing serialization due to changes in boost recently, I would like to keep that.

HTH, v.

Revision history for this message
Klaus Thoeni (klaus.thoeni) said :
#9

Well, it's not solving the problem since the behaviour is similar as it was with the segmentation fault:

terminate called after throwing an instance of 'std::invalid_argument'
  what(): WireMat.strainStressValue is empty!
Aborted

Why the problem is not solved with initialising the attribute?

And something else I recognised, postLoad is called twice (just but a cerr to see it). Any idea?

Thaks

Klaus

Revision history for this message
Launchpad Janitor (janitor) said :
#10

This question was expired because it remained in the 'Open' state without activity for the last 15 days.