Replies: 8 comments 6 replies
-
I like your approach, but I've found that most of the time when I want to do something differently from Rob, unless it's something he's specifically designed to be overridden (like system definition & the config files), it's usually easier to just modify his code. I don't mean to discourage you from your approach...its just my opinion that it wasn't worth the effort. (I'm lazy.) OTOH, like you, I also want to keep up to date with his latest changes. Some ways I manage that:
That makes it easy fetch his latest changes and merge them into my repository.
Bonus tip: This should go without saying, but if you are running a production system, always test things in a non-production environment first. Especially if you're merging in a bunch of Rob's changes where you may not necessarily understand all the impacts. |
Beta Was this translation helpful? Give feedback.
-
What I would do is what I do myself - use the private directory for your own stuff, but never change the original source code outside of that (and @tgibson11 has given you a nice method for keeping this up to date). As well as your own config, you might for example inherit from the classes I use (I do this for raw data for example to get extra trading rules). Then you can just pull the changes that come in automatically (of course being careful to test / understand for production code - I would have a segregated repo, ideally on another machine, for this purpose) |
Beta Was this translation helpful? Give feedback.
-
I need to up my git game - @tgibson11 those sound like good suggestions. |
Beta Was this translation helpful? Give feedback.
-
This is a great question. Like @tgibson11, my fork has a lot of custom code, but I also want to keep up to date with Rob's incoming changes. My solution:
|
Beta Was this translation helpful? Give feedback.
-
I don't think those are mutually exclusive. I do all of them, as I feel it is appropriate. I definitely import his scripts into my own, otherwise I'd be duplicating a lot of code. The classes that define & run my system inherit from Rob's classes. I might have 1 or 2 others, but not many. In theory it would be nice to do this more, but then I would STILL have to modify Rob's code to use my new class, except where overriding is expected and explicitly supported. What I mostly do is modify Rob's scripts. Let me give you an example of what I mean: I use IB's adaptive market orders instead of Rob's execution algo (which uses limit orders). I'd have to override a few of Rob's classes to support that, then I'd have to also modify every script that references the overridden classes to use my own instead. So I'm still modifying Rob's code...unless I also override THOSE classes, and then the classes that reference THOSE, and so on. By the end I would have re-written much of pysystemtrade. |
Beta Was this translation helpful? Give feedback.
-
I'm like @tgibson11 - all of the above. Whatever is needed to get the job done, whilst making minimal changes to the codebase, and improving the code for other users if possible. The best resource I found for getting to know git was the Atlassian tutorial site: |
Beta Was this translation helpful? Give feedback.
-
Thanks all for the suggestions |
Beta Was this translation helpful? Give feedback.
-
Am considering using a private repo as a submodule to manage my private folder. Does anyone else do it this way or is there a more elegant way to source control things you'd rather not be in the public repo? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This question may be better on StackExchange, but asking here, as everyone using pysystemtrade needs to deal with this. I have little prior experience of working with git and I'm wondering how best to work with the codebase. I've created my own fork in github. I want to be able to get all updates to the original codebase.
Rather than change Rob's scripts directly, I'm using import to access them from my own scripts, and then making tweaks, e.g. changing paths, changing the values of variables, and maybe not calling all of Rob's functions as I have preprocessed some of the market data in my own code.
I copy & paste the "if name == main" section, so violating DRY, but (so far) these sections are quite small - I'm currently focused on the "data" section of the implementation.
My reasoning for this approach is I don't know how much the original scripts could change, and I'm worried that if I amend them directly, they could break due to updates to the source, which are pretty frequent.
Is there a best practice? What are other people doing?
Beta Was this translation helpful? Give feedback.
All reactions